Browse Source

avcodec/parser: Optimize ff_combine_frame() with massivly negative next

Fixes: Timeout
Fixes: 15558/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5705273643106304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 5 years ago
parent
commit
8a24d2cc30
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/parser.c

+ 4
- 0
libavcodec/parser.c View File

@@ -295,6 +295,10 @@ int ff_combine_frame(ParseContext *pc, int next,
*buf = pc->buffer;
}

if (next < -8) {
pc->overread += -8 - next;
next = -8;
}
/* store overread bytes */
for (; next < 0; next++) {
pc->state = pc->state << 8 | pc->buffer[pc->last_index + next];


Loading…
Cancel
Save