mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-14 22:22:59 +02:00
avcodec/ituh263dec: Make the condition for the studio slice start code match between ff_h263_resync() and ff_mpeg4_decode_studio_slice_header()
If they mismatch an infinite loop can occur Fixes: Timeout (infinite loop) Fixes: 17043/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5695051748868096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8335ba8ae99941422bef0e16ea8cf1ebe2e9a7b3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6b9a6088d6
commit
20a923a3ae
@ -222,7 +222,7 @@ int ff_h263_resync(MpegEncContext *s){
|
||||
get_bits(&s->gb, 8);
|
||||
}
|
||||
|
||||
if (show_bits_long(&s->gb, 32) == SLICE_START_CODE)
|
||||
if (get_bits_left(&s->gb) >= 32 && show_bits_long(&s->gb, 32) == SLICE_START_CODE)
|
||||
return get_bits_count(&s->gb);
|
||||
else
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user