aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-05 01:06:18 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-15 17:39:04 +0100
commitd472b83abc765cc84e569b3778c746c6179a5d2f (patch)
tree829a07e3a783ace41fede446eeaa12eb0c4d98a2 /libavcodec
parentc3abdd0f44615f0bbfde3ebcd1fddabd23d0b332 (diff)
downloadffmpeg-d472b83abc765cc84e569b3778c746c6179a5d2f.tar.gz
avcodec/h264_slice: Fix integer overflow in implicit weight computation
Fixes mozilla bug 1230423 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7cc01c25727a96eaaa0c177234b626e47c8ea491) Conflicts: libavcodec/h264_slice.c Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_slice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 57a135efc6..b24978a95a 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -924,7 +924,7 @@ static void implicit_weight_table(H264Context *h, int field)
cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
}
if (h->ref_count[0] == 1 && h->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
- h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2 * cur_poc) {
+ h->ref_list[0][0].poc + (int64_t)h->ref_list[1][0].poc == 2 * cur_poc) {
h->use_weight = 0;
h->use_weight_chroma = 0;
return;
@@ -945,7 +945,7 @@ static void implicit_weight_table(H264Context *h, int field)
h->chroma_log2_weight_denom = 5;
for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
- int poc0 = h->ref_list[0][ref0].poc;
+ int64_t poc0 = h->ref_list[0][ref0].poc;
for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
int w = 32;
if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {