avcodec/mpeg4videodec: Fix slice end detection in mpeg4_decode_studio_mb()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 19 Aug 2018 08:15:53 +0000 (10:15 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 25 Aug 2018 16:50:30 +0000 (18:50 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mpeg4videodec.c

index 24c280d..1686ed1 100644 (file)
@@ -1955,6 +1955,14 @@ static int mpeg4_decode_studio_mb(MpegEncContext *s, int16_t block_[12][64])
         return SLICE_END;
     }
 
         return SLICE_END;
     }
 
+    //vcon-stp9L1.bits (first frame)
+    if (get_bits_left(&s->gb) == 0)
+        return SLICE_END;
+
+    //vcon-stp2L1.bits, vcon-stp3L1.bits, vcon-stp6L1.bits, vcon-stp7L1.bits, vcon-stp8L1.bits, vcon-stp10L1.bits (first frame)
+    if (get_bits_left(&s->gb) < 8U && show_bits(&s->gb, get_bits_left(&s->gb)) == 0)
+        return SLICE_END;
+
     return SLICE_OK;
 }
 
     return SLICE_OK;
 }