aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-02-14 00:05:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-24 10:38:51 +0100
commit8ddad9f9cdac4bf05a455fe5bb3efdab5957d1e4 (patch)
treeb8a80f4a740a2b7b5b557fe3bea525c55011e56e
parent1613b1669d023cb81c832b209b817e783262e8e2 (diff)
downloadffmpeg-8ddad9f9cdac4bf05a455fe5bb3efdab5957d1e4.tar.gz
avcodec/h264_direct: Fix overflow in POC comparission
Fixes: runtime error: signed integer overflow: 2147421862 - -33624063 cannot be represented in type 'int' Fixes: 12885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5733516975800320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5ccf296e74725bc8bdfbfe500d0482daa200b6f3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/h264_direct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index a7a107c8c2..3825996762 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -156,8 +156,8 @@ void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *
av_log(h->avctx, AV_LOG_ERROR, "co located POCs unavailable\n");
sl->col_parity = 1;
} else
- sl->col_parity = (FFABS(col_poc[0] - cur_poc) >=
- FFABS(col_poc[1] - cur_poc));
+ sl->col_parity = (FFABS(col_poc[0] - (int64_t)cur_poc) >=
+ FFABS(col_poc[1] - (int64_t)cur_poc));
ref1sidx =
sidx = sl->col_parity;
// FL -> FL & differ parity