avcodec/h264_refs: Fix long_idx check
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 19 Dec 2015 20:59:42 +0000 (21:59 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 20 Dec 2015 02:24:22 +0000 (03:24 +0100)
Fixes out of array read
Fixes mozilla bug 1233606

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b92b4775a0d07cacfdd2b4be6511f3cb362c977b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/h264_refs.c

index 2d787a5..29045df 100644 (file)
@@ -303,7 +303,7 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl)
 
                     long_idx = pic_num_extract(h, pic_id, &pic_structure);
 
-                    if (long_idx > 31) {
+                    if (long_idx > 31U) {
                         av_log(h->avctx, AV_LOG_ERROR,
                                "long_term_pic_idx overflow\n");
                         return AVERROR_INVALIDDATA;