diff options
author | Benoit Fouet <benoit.fouet@free.fr> | 2007-09-26 11:32:51 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-09-26 11:32:51 +0000 |
commit | 602dd8f6c4d4f7e1b5f48cc580fd9b694d41d602 (patch) | |
tree | 88ab2f803f7bc40adb2777a5e49b834e5f90ada3 /libavformat/aviobuf.c | |
parent | 0d2caa37c53bb8b479840572cb4dede2e2b30e8e (diff) | |
download | ffmpeg-streaming-602dd8f6c4d4f7e1b5f48cc580fd9b694d41d602.zip ffmpeg-streaming-602dd8f6c4d4f7e1b5f48cc580fd9b694d41d602.tar.gz |
Check read_packet before using it.
Originally committed as revision 10588 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index e7d9a62..f156d95 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -263,7 +263,7 @@ void put_tag(ByteIOContext *s, const char *tag) static void fill_buffer(ByteIOContext *s) { - int len; + int len=0; /* no need to do anything if EOF already reached */ if (s->eof_reached) @@ -275,6 +275,7 @@ static void fill_buffer(ByteIOContext *s) s->checksum_ptr= s->buffer; } + if(s->read_packet) len = s->read_packet(s->opaque, s->buffer, s->buffer_size); if (len <= 0) { /* do not modify buffer if EOF reached so that a seek back can @@ -341,6 +342,7 @@ int get_buffer(ByteIOContext *s, unsigned char *buf, int size) len = size; if (len == 0) { if(size > s->buffer_size && !s->update_checksum){ + if(s->read_packet) len = s->read_packet(s->opaque, buf, size); if (len <= 0) { /* do not modify buffer if EOF reached so that a seek back can |