diff options
author | Måns Rullgård <mans@mansr.com> | 2010-03-16 21:45:30 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-03-16 21:45:30 +0000 |
commit | c7f625eecff0fb76f077d516c15a586576466e67 (patch) | |
tree | 6c584410996bf07fcaf78676aa6e4b4d4ae1c1cf /libavformat/utils.c | |
parent | 3bd74e92434ba4030878ecae00db0c66649e2337 (diff) | |
download | ffmpeg-c7f625eecff0fb76f077d516c15a586576466e67.tar.gz |
Fix erroneous behaviour when format probe hits end of file
If the format probe hits end of file, do not add the error code
to the buffer position. This is obviously wrong, and with a
small input file would cause a negative buffer overflow.
Fixes issue 1818.
Originally committed as revision 22571 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index fa7e8dea77..d9478dbbd0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -495,6 +495,7 @@ int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, return ret; } score = 0; + ret = 0; /* error was end of file, nothing read */ } pd.buf_size += ret; pd.buf = &buf[offset]; |