diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-05-18 23:11:09 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-05-18 23:11:09 +0000 |
commit | 1ea4f593658c8b161a0a725252058b49c16a6b29 (patch) | |
tree | 5bf96a2a7242b8a0c227a196a3368188a77f9d8e /libav/avidec.c | |
parent | 065422677a17ddb3d84a3b85b5064eb7df7e2c8a (diff) | |
download | ffmpeg-1ea4f593658c8b161a0a725252058b49c16a6b29.tar.gz |
use av memory handling functions
Originally committed as revision 528 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/avidec.c')
-rw-r--r-- | libav/avidec.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libav/avidec.c b/libav/avidec.c index a3d5a8fa6d..4af2d661b9 100644 --- a/libav/avidec.c +++ b/libav/avidec.c @@ -54,7 +54,7 @@ int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) int i, bps; AVStream *st; - avi = malloc(sizeof(AVIContext)); + avi = av_malloc(sizeof(AVIContext)); if (!avi) return -1; memset(avi, 0, sizeof(AVIContext)); @@ -106,7 +106,7 @@ int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) s->nb_streams = get_le32(pb); for(i=0;i<s->nb_streams;i++) { AVStream *st; - st = malloc(sizeof(AVStream)); + st = av_malloc(sizeof(AVStream)); if (!st) goto fail; memset(st, 0, sizeof(AVStream)); @@ -198,8 +198,7 @@ int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) if (stream_index != s->nb_streams - 1) { fail: for(i=0;i<s->nb_streams;i++) { - if (s->streams[i]) - free(s->streams[i]); + av_freep(&s->streams[i]); } return -1; } @@ -248,6 +247,6 @@ int avi_read_packet(AVFormatContext *s, AVPacket *pkt) int avi_read_close(AVFormatContext *s) { AVIContext *avi = s->priv_data; - free(avi); + av_free(avi); return 0; } |