10l (segfault fix)
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Jun 2005 08:48:10 +0000 (08:48 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Jun 2005 08:48:10 +0000 (08:48 +0000)
Originally committed as revision 4341 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/aviobuf.c

index 06da44d..55fa57c 100644 (file)
@@ -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;
     }