diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-19 20:52:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-19 21:14:26 +0200 |
commit | 7383a835e47cd8915ff9cdd693e06716dbae3b3a (patch) | |
tree | 0c534ee77350f14357db19168d3a1d3911043ddc /libavformat/aviobuf.c | |
parent | 162414cefee64eff114179a45abc45aca5133ed0 (diff) | |
download | ffmpeg-7383a835e47cd8915ff9cdd693e06716dbae3b3a.tar.gz |
avformat/aviobuf: Only downscale the buffer once it has been used
The code mistook the first iteration sometimes as the end
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 0a7c39eacd..1667e9f08b 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -542,7 +542,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 (dst == s->buffer) { + if (dst == s->buffer && s->buf_ptr != dst) { int ret = ffio_set_buf_size(s, s->orig_buffer_size); if (ret < 0) av_log(s, AV_LOG_WARNING, "Failed to decrease buffer size\n"); |