]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dirac_parser.c
imgconvert: fix 2 "discards const qualifier from pointer target type"
[ffmpeg] / libavcodec / dirac_parser.c
index a7c7c328ade3d0d4e1d4ba561b324f0a9370a55e..a2a22ee5b22182b54d1e3eaefd6cba038505b571 100644 (file)
@@ -161,7 +161,9 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
          * we can be pretty sure that we have a valid parse unit */
         if (!unpack_parse_unit(&pu1, pc, pc->index - 13)                     ||
             !unpack_parse_unit(&pu, pc, pc->index - 13 - pu1.prev_pu_offset) ||
-            pu.next_pu_offset != pu1.prev_pu_offset) {
+            pu.next_pu_offset != pu1.prev_pu_offset                          ||
+            pc->index < pc->dirac_unit_size + 13LL + pu1.prev_pu_offset
+        ) {
             pc->index -= 9;
             *buf_size = next-9;
             pc->header_bytes_needed = 9;