diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-27 11:50:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-27 11:54:53 +0100 |
commit | 09ef98f1ae3c8a4e08b66f41c3bd97dd7b07405f (patch) | |
tree | 6a08dd64d30637e8bbdf60446338b9377f42a651 /libavcodec/hevcpred_template.c | |
parent | 10386710fd8eacd3ce5897d1ff4d7f14a3110028 (diff) | |
download | ffmpeg-09ef98f1ae3c8a4e08b66f41c3bd97dd7b07405f.tar.gz |
avcodec/hevcpred_template: Fix integer overflows
signed integer overflow is undefined in C
Fixes the following gcc warnings:
In file included from libavcodec/hevcpred.c:27:0:
libavcodec/hevcpred_template.c: In function ‘intra_pred_8’:
libavcodec/hevcpred_template.c:302:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
In file included from libavcodec/hevcpred.c:31:0:
libavcodec/hevcpred_template.c: In function ‘intra_pred_9’:
libavcodec/hevcpred_template.c:302:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
In file included from libavcodec/hevcpred.c:35:0:
libavcodec/hevcpred_template.c: In function ‘intra_pred_10’:
libavcodec/hevcpred_template.c:302:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevcpred_template.c')
-rw-r--r-- | libavcodec/hevcpred_template.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c index 969750675c..f055bb6095 100644 --- a/libavcodec/hevcpred_template.c +++ b/libavcodec/hevcpred_template.c @@ -299,8 +299,8 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int // Filtering process if (c_idx == 0 && mode != INTRA_DC && size != 4) { int intra_hor_ver_dist_thresh[] = { 7, 1, 0 }; - int min_dist_vert_hor = FFMIN(FFABS((int)mode - 26), - FFABS((int)mode - 10)); + int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)), + FFABS((int)(mode - 10U))); if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) { int threshold = 1 << (BIT_DEPTH - 5); if (s->sps->sps_strong_intra_smoothing_enable_flag && |