[FFmpeg-cvslog] lavf: prevent crash in av_open_input_file() if ap == NULL.

Ronald S. Bultje git at videolan.org
Sun Jun 19 04:16:48 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sat Jun 18 15:33:49 2011 -0400| [dbafb0e06faa092f60e53d845957fbab7f2a3f2d] | committer: Ronald S. Bultje

lavf: prevent crash in av_open_input_file() if ap == NULL.

Needed for proper behaviour in our old API compatibility code.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbafb0e06faa092f60e53d845957fbab7f2a3f2d
---

 libavformat/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 81bc9b7..7370c60 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -549,7 +549,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
     int err;
     AVDictionary *opts = convert_format_parameters(ap);
 
-    if (!ap->prealloced_context)
+    if (!ap || !ap->prealloced_context)
         *ic_ptr = NULL;
 
     err = avformat_open_input(ic_ptr, filename, fmt, &opts);



More information about the ffmpeg-cvslog mailing list