[FFmpeg-cvslog] r20265 - trunk/libavformat/utils.c

vitor subversion
Sat Oct 17 22:37:59 CEST 2009


Author: vitor
Date: Sat Oct 17 22:37:58 2009
New Revision: 20265

Log:
Avoid segfault for empty input files

Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Sat Oct 17 21:35:47 2009	(r20264)
+++ trunk/libavformat/utils.c	Sat Oct 17 22:37:58 2009	(r20265)
@@ -469,6 +469,12 @@ int av_open_input_file(AVFormatContext *
             /* read probe data */
             pd->buf= av_realloc(pd->buf, probe_size + AVPROBE_PADDING_SIZE);
             pd->buf_size = get_buffer(pb, pd->buf, probe_size);
+
+            if ((int)pd->buf_size < 0) {
+                err = pd->buf_size;
+                goto fail;
+            }
+
             memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
             if (url_fseek(pb, 0, SEEK_SET) < 0) {
                 url_fclose(pb);



More information about the ffmpeg-cvslog mailing list