diff utils.c @ 5854:3dc78fb78b2a libavformat

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.
author mru
date Tue, 16 Mar 2010 21:45:30 +0000
parents cf00e196666a
children 731cb836bca6
line wrap: on
line diff
--- a/utils.c	Mon Mar 15 23:15:24 2010 +0000
+++ b/utils.c	Tue Mar 16 21:45:30 2010 +0000
@@ -495,6 +495,7 @@
                 return ret;
             }
             score = 0;
+            ret = 0;            /* error was end of file, nothing read */
         }
         pd.buf_size += ret;
         pd.buf = &buf[offset];