summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2008-04-21 01:22:25 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2008-04-21 01:22:25 +0000
commit8767060cd2e5f9a29251f90b98b0f0cdafad93ef (patch)
tree9f5e0c38f859a6f9164a723f4ec9c0eecfc989cb
parentb189e6705ab47937248877a620be1a047d9741fe (diff)
Fix bug introduced by r12827.
If av_exit() was called after an AVFormatContext was created, but before its file was opened, av_exit() would pass a NULL pointer to url_fclose(). Originally committed as revision 12915 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 333f786cf3..5161565110 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -380,7 +380,7 @@ static int av_exit(int ret)
/* maybe av_close_output_file ??? */
AVFormatContext *s = output_files[i];
int j;
- if (!(s->oformat->flags & AVFMT_NOFILE))
+ if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
url_fclose(s->pb);
for(j=0;j<s->nb_streams;j++) {
av_free(s->streams[j]->codec);