always use the whole buffer for reading w/ packetized sources to avoid packet truncation
authorJindřich Makovička <makovick@gmail.com>
Mon, 10 Nov 2008 21:41:35 +0000 (21:41 +0000)
committerJindřich Makovička <makovick@gmail.com>
Mon, 10 Nov 2008 21:41:35 +0000 (21:41 +0000)
Originally committed as revision 15799 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/aviobuf.c

index 344664c1912b66835c0c39a05318a030436eac26..e19e70beb4509689d45288b6522ddced2daa169f 100644 (file)
@@ -290,7 +290,7 @@ void put_tag(ByteIOContext *s, const char *tag)
 
 static void fill_buffer(ByteIOContext *s)
 {
-    uint8_t *dst= s->buf_end - s->buffer < s->buffer_size ? s->buf_ptr : s->buffer;
+    uint8_t *dst= !s->max_packet_size && s->buf_end - s->buffer < s->buffer_size ? s->buf_ptr : s->buffer;
     int len= s->buffer_size - (dst - s->buffer);
 
     assert(s->buf_ptr == s->buf_end);