History

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

Måns Rullgård committed 16 years ago

Commit c7f625e1 parent 3bd74e91 file · +1 −0Browse files

Unified · Split

libavformat/utils.c+1−0
@@ -495,6 +495,7 @@ int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, · 494 unmodified lines
495495 return ret;
496496 }
497497 score = 0;
498+ ret = 0; /* error was end of file, nothing read */
498499 }
499500 pd.buf_size += ret;
500501 pd.buf = &buf[offset];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t