Commit c4591c8e authored by aurel's avatar aurel

Don't need to check for NULL before av_free().

And don't need to memset(0) the no more used priv_data.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6925 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e870e592
...@@ -2609,11 +2609,8 @@ matroska_read_close (AVFormatContext *s) ...@@ -2609,11 +2609,8 @@ matroska_read_close (AVFormatContext *s)
MatroskaDemuxContext *matroska = s->priv_data; MatroskaDemuxContext *matroska = s->priv_data;
int n = 0; int n = 0;
if (matroska->writing_app)
av_free(matroska->writing_app); av_free(matroska->writing_app);
if (matroska->muxing_app)
av_free(matroska->muxing_app); av_free(matroska->muxing_app);
if (matroska->index)
av_free(matroska->index); av_free(matroska->index);
if (matroska->packets != NULL) { if (matroska->packets != NULL) {
...@@ -2626,22 +2623,15 @@ matroska_read_close (AVFormatContext *s) ...@@ -2626,22 +2623,15 @@ matroska_read_close (AVFormatContext *s)
for (n = 0; n < matroska->num_tracks; n++) { for (n = 0; n < matroska->num_tracks; n++) {
MatroskaTrack *track = matroska->tracks[n]; MatroskaTrack *track = matroska->tracks[n];
if (track->codec_id)
av_free(track->codec_id); av_free(track->codec_id);
if (track->codec_name)
av_free(track->codec_name); av_free(track->codec_name);
if (track->codec_priv)
av_free(track->codec_priv); av_free(track->codec_priv);
if (track->name)
av_free(track->name); av_free(track->name);
if (track->language)
av_free(track->language); av_free(track->language);
av_free(track); av_free(track);
} }
memset(matroska, 0, sizeof(MatroskaDemuxContext));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment