diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 06da44d8dc..55fa57ca73 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -272,7 +272,8 @@ static void fill_buffer(ByteIOContext *s) return; if(s->update_checksum){ - s->checksum= s->update_checksum(s->checksum, s->checksum_ptr, s->buf_end - s->checksum_ptr); + if(s->buf_end > s->checksum_ptr) + s->checksum= s->update_checksum(s->checksum, s->checksum_ptr, s->buf_end - s->checksum_ptr); s->checksum_ptr= s->buffer; }