mpegtsenc: Clear st->priv_data when freeing it
authorMartin Storsjö <martin@martin.st>
Mon, 9 May 2011 13:29:01 +0000 (16:29 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 9 May 2011 16:14:40 +0000 (19:14 +0300)
If not cleared, the caller might try to free it.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/mpegtsenc.c

index bf66aa0..55a16f7 100644 (file)
@@ -588,7 +588,7 @@ static int mpegts_write_header(AVFormatContext *s)
     av_free(pids);
     for(i = 0;i < s->nb_streams; i++) {
         st = s->streams[i];
-        av_free(st->priv_data);
+        av_freep(&st->priv_data);
     }
     return -1;
 }