]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mobiclip: Use get_ue_golomb_31() where possible
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 5 Nov 2020 21:03:57 +0000 (22:03 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 15 Nov 2020 18:00:57 +0000 (19:00 +0100)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mobiclip.c

index 9fa88e84a0589b5ed2602f4fa39abc0cdcd58862..42d33cf6a554e117283f3501b65916ec4c198c5c 100644 (file)
@@ -539,11 +539,11 @@ static int add_pframe_coefficients(AVCodecContext *avctx, AVFrame *frame,
 {
     MobiClipContext *s = avctx->priv_data;
     GetBitContext *gb = &s->gb;
-    int ret, idx = get_ue_golomb(gb);
+    int ret, idx = get_ue_golomb_31(gb);
 
     if (idx == 0) {
         ret = add_coefficients(avctx, frame, bx, by, size, plane);
-    } else if (idx < FF_ARRAY_ELEMS(pframe_block4x4_coefficients_tab)) {
+    } else if ((unsigned)idx < FF_ARRAY_ELEMS(pframe_block4x4_coefficients_tab)) {
         int flags = pframe_block4x4_coefficients_tab[idx];
 
         for (int y = by; y < by + 8; y += 4) {
@@ -1012,8 +1012,8 @@ static int process_block(AVCodecContext *avctx, AVFrame *frame,
         return predict_intra(avctx, frame, x, y, pmode, 0, 8, plane);
     }
 
-    tmp = get_ue_golomb(gb);
-    if (tmp < 0 || tmp > FF_ARRAY_ELEMS(block4x4_coefficients_tab))
+    tmp = get_ue_golomb_31(gb);
+    if ((unsigned)tmp > FF_ARRAY_ELEMS(block4x4_coefficients_tab))
         return AVERROR_INVALIDDATA;
 
     if (tmp == 0) {