aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-06 12:48:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-06 16:09:30 +0100
commit8abe459ac6ce26654986ac9df8d933cbe462199b (patch)
tree9014ffbe855513ebe0a990401b4ef42e647cf8c1 /libavformat/matroskadec.c
parentbebe3d35f3620cae6aeb83f8cd795cc8dce5f0e4 (diff)
downloadffmpeg-8abe459ac6ce26654986ac9df8d933cbe462199b.tar.gz
avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6e70e4aca50696040cc9256ec96e5c31d9641432) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index cc6450e51a..6ab51c69d5 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1051,7 +1051,7 @@ static void ebml_free(EbmlSyntax *syntax, void *data)
char *ptr = list->elem;
for (j=0; j<list->nb_elem; j++, ptr+=syntax[i].list_elem_size)
ebml_free(syntax[i].def.n, ptr);
- av_free(list->elem);
+ av_freep(&list->elem);
} else
ebml_free(syntax[i].def.n, data_off);
default: break;
@@ -2033,7 +2033,7 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
{
if (matroska->num_packets > 0) {
memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
- av_free(matroska->packets[0]);
+ av_freep(&matroska->packets[0]);
if (matroska->num_packets > 1) {
void *newpackets;
memmove(&matroska->packets[0], &matroska->packets[1],
@@ -2063,7 +2063,7 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
int n;
for (n = 0; n < matroska->num_packets; n++) {
av_free_packet(matroska->packets[n]);
- av_free(matroska->packets[n]);
+ av_freep(&matroska->packets[n]);
}
av_freep(&matroska->packets);
matroska->num_packets = 0;
@@ -2903,7 +2903,7 @@ static int matroska_read_close(AVFormatContext *s)
for (n=0; n < matroska->tracks.nb_elem; n++)
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
- av_free(tracks[n].audio.buf);
+ av_freep(&tracks[n].audio.buf);
ebml_free(matroska_cluster, &matroska->current_cluster);
ebml_free(matroska_segment, matroska);