Browse Source

avformat: Make avformat_free_context handle NULL

Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable@libav.org
tags/n2.4.7
Luca Barbato Vittorio Giovara 11 years ago
parent
commit
bb823e26b1
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/utils.c

+ 3
- 0
libavformat/utils.c View File

@@ -2447,6 +2447,9 @@ void avformat_free_context(AVFormatContext *s)
int i, j; int i, j;
AVStream *st; AVStream *st;


if (!s)
return;

av_opt_free(s); av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data) if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data); av_opt_free(s->priv_data);


Loading…
Cancel
Save