]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv10.c
Merge commit '12b54a1f39fee22fa0399825ae47a43e60bad4c5'
[ffmpeg] / libavcodec / rv10.c
index 2334fd1f1261bd5470e057b094d1acbc4f76890a..8cd7d0370ff3f305d8bb747f58ed6c59b954e8ea 100644 (file)
@@ -505,7 +505,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
     if (ff_MPV_common_init(s) < 0)
         return -1;
 
-    ff_h263_decode_init_vlc(s);
+    ff_h263_decode_init_vlc();
 
     /* init rv vlc */
     if (!done) {
@@ -695,11 +695,15 @@ static int rv10_decode_frame(AVCodecContext *avctx,
     if(!avctx->slice_count){
         slice_count = (*buf++) + 1;
         buf_size--;
+
+        if (!slice_count || buf_size <= 8 * slice_count) {
+            av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n", slice_count);
+            return AVERROR_INVALIDDATA;
+        }
+
         slices_hdr = buf + 4;
         buf += 8 * slice_count;
         buf_size -= 8 * slice_count;
-        if (buf_size <= 0)
-            return AVERROR_INVALIDDATA;
     }else
         slice_count = avctx->slice_count;