1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-01 08:49:59 +02:00

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
This commit is contained in:
Ramiro Polla 2008-04-21 01:22:25 +00:00
parent b189e6705a
commit 8767060cd2

View File

@ -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);