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
Unified · Split
| @@ -495,6 +495,7 @@ int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, · 494 unmodified lines | ||
| 495 | 495 | return ret; |
| 496 | 496 | } |
| 497 | 497 | score = 0; |
| 498 | + ret = 0; /* error was end of file, nothing read */ | |
| 498 | 499 | } |
| 499 | 500 | pd.buf_size += ret; |
| 500 | 501 | pd.buf = &buf[offset]; |