]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/dirac_parser: Fix overflow in dts
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 Jul 2019 21:23:07 +0000 (23:23 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 5 Aug 2019 15:54:24 +0000 (17:54 +0200)
Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 15568/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5634719611355136
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dirac_parser.c

index 1ade44a438dd2b63b12bec706b15576f443f5de5..fbc7414c791ea95d50dc0f6f8d1175681dae8e2a 100644 (file)
@@ -212,7 +212,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
         if (parse_timing_info && pu1.prev_pu_offset >= 13) {
             uint8_t *cur_pu = pc->buffer +
                               pc->index - 13 - pu1.prev_pu_offset;
-            int pts = AV_RB32(cur_pu + 13);
+            int64_t pts = AV_RB32(cur_pu + 13);
             if (s->last_pts == 0 && s->last_dts == 0)
                 s->dts = pts - 1;
             else