]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Only use *ic_ptr when it has been initialized.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 18 Sep 2009 13:19:13 +0000 (13:19 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 18 Sep 2009 13:19:13 +0000 (13:19 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19911 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/utils.c

index 4b65010967dc2d827c5a0d03c1ed5f0ad4525621..1e8a2f4280d18367ab6a951e782140da0a81cc0e 100644 (file)
@@ -437,6 +437,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
     int err, probe_size;
     AVProbeData probe_data, *pd = &probe_data;
     ByteIOContext *pb = NULL;
+    void *logctx= ap && ap->prealloced_context ? *ic_ptr : NULL;
 
     pd->filename = "";
     if (filename)
@@ -478,9 +479,9 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
             fmt = av_probe_input_format2(pd, 1, &score);
             if(fmt){
                 if(score <= AVPROBE_SCORE_MAX/4){ //this can only be true in the last iteration
-                    av_log(*ic_ptr, AV_LOG_WARNING, "Format detected only with low score of %d, misdetection possible!\n", score);
+                    av_log(logctx, AV_LOG_WARNING, "Format detected only with low score of %d, misdetection possible!\n", score);
                 }else
-                    av_log(*ic_ptr, AV_LOG_DEBUG, "Probed with size=%d and score=%d\n", probe_size, score);
+                    av_log(logctx, AV_LOG_DEBUG, "Probed with size=%d and score=%d\n", probe_size, score);
             }
         }
         av_freep(&pd->buf);