mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
avformat/aviobuf: Delay buffer downsizing until asserts are met
Fixes: Assertion failure Fixes: 15151/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5757079496687616 Fixes: 15205/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5767573242642432 May fix: Ticket7094 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
eb82d19f03
commit
0334632d5c
@ -570,7 +570,7 @@ static void fill_buffer(AVIOContext *s)
|
||||
}
|
||||
|
||||
/* make buffer smaller in case it ended up large after probing */
|
||||
if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size) {
|
||||
if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size && len >= s->orig_buffer_size) {
|
||||
if (dst == s->buffer && s->buf_ptr != dst) {
|
||||
int ret = ffio_set_buf_size(s, s->orig_buffer_size);
|
||||
if (ret < 0)
|
||||
@ -578,7 +578,6 @@ static void fill_buffer(AVIOContext *s)
|
||||
|
||||
s->checksum_ptr = dst = s->buffer;
|
||||
}
|
||||
av_assert0(len >= s->orig_buffer_size);
|
||||
len = s->orig_buffer_size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user