Message ID | 20190131002351.10475-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 1e59071aad9582fd2ef53b3e9c0dcf4ee913af0f |
Headers | show |
On Thu, Jan 31, 2019 at 01:23:51AM +0100, Michael Niedermayer wrote: > Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) > Fixes: Timeout > Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 > Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 > Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/ac3dec.c | 2 ++ > 1 file changed, 2 insertions(+) will apply [...]
On Thu, Jan 31, 2019 at 1:25 AM Michael Niedermayer <michael@niedermayer.cc> wrote: > > Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) > Fixes: Timeout > Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 > Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 > Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/ac3dec.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c > index f844a463ee..eaa327a3ee 100644 > --- a/libavcodec/ac3dec.c > +++ b/libavcodec/ac3dec.c > @@ -1490,6 +1490,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, > } > if (i >= buf_size) > return AVERROR_INVALIDDATA; > + if (i > 10) > + return i; > buf += i; > buf_size -= i; > How exactly does this speed up the decoder, anyway? Isn't the garbage immediately skipped right after this return? - Hendrik
On Thu, Feb 07, 2019 at 01:28:35AM +0100, Hendrik Leppkes wrote: > On Thu, Jan 31, 2019 at 1:25 AM Michael Niedermayer > <michael@niedermayer.cc> wrote: > > > > Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) > > Fixes: Timeout > > Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 > > Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 > > Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 > > > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavcodec/ac3dec.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c > > index f844a463ee..eaa327a3ee 100644 > > --- a/libavcodec/ac3dec.c > > +++ b/libavcodec/ac3dec.c > > @@ -1490,6 +1490,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, > > } > > if (i >= buf_size) > > return AVERROR_INVALIDDATA; > > + if (i > 10) > > + return i; > > buf += i; > > buf_size -= i; > > > > How exactly does this speed up the decoder, anyway? Isn't the garbage > immediately skipped right after this return? no, the return is limited to the (super) frame size so it re scans the garbage over and over again thx [...]
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index f844a463ee..eaa327a3ee 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1490,6 +1490,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, } if (i >= buf_size) return AVERROR_INVALIDDATA; + if (i > 10) + return i; buf += i; buf_size -= i;
Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) Fixes: Timeout Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/ac3dec.c | 2 ++ 1 file changed, 2 insertions(+)