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;jnb_streams;j++) { av_free(s->streams[j]->codec);