Commit e32c6225 authored by mstorsjo's avatar mstorsjo

Fix leaks in the AAC RTP depacketizer


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22804 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 75ea2f23
...@@ -400,7 +400,11 @@ static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf) ...@@ -400,7 +400,11 @@ static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
return -1; return -1;
infos->nb_au_headers = au_headers_length / au_header_size; infos->nb_au_headers = au_headers_length / au_header_size;
if (!infos->au_headers || infos->au_headers_allocated < infos->nb_au_headers) {
av_free(infos->au_headers);
infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers); infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);
infos->au_headers_allocated = infos->nb_au_headers;
}
/* XXX: We handle multiple AU Section as only one (need to fix this for interleaving) /* XXX: We handle multiple AU Section as only one (need to fix this for interleaving)
In my test, the FAAD decoder does not behave correctly when sending each AU one by one In my test, the FAAD decoder does not behave correctly when sending each AU one by one
...@@ -599,6 +603,8 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, ...@@ -599,6 +603,8 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
void rtp_parse_close(RTPDemuxContext *s) void rtp_parse_close(RTPDemuxContext *s)
{ {
// TODO: fold this into the protocol specific data fields. // TODO: fold this into the protocol specific data fields.
av_free(s->rtp_payload_data->mode);
av_free(s->rtp_payload_data->au_headers);
if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) { if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) {
ff_mpegts_parse_close(s->ts); ff_mpegts_parse_close(s->ts);
} }
......
...@@ -48,6 +48,7 @@ typedef struct rtp_payload_data ...@@ -48,6 +48,7 @@ typedef struct rtp_payload_data
int rap_flag; int rap_flag;
int streamstate; int streamstate;
} *au_headers; } *au_headers;
int au_headers_allocated;
int nb_au_headers; int nb_au_headers;
int au_headers_length_bytes; int au_headers_length_bytes;
int cur_au_index; int cur_au_index;
......
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