comparison xa.c @ 5673:dec5ac461e93 libavformat

Fix memory leak for truncated frames
author vitor
date Fri, 19 Feb 2010 20:20:17 +0000
parents a026efc0ca86
children 536e5527c1e0
comparison
equal deleted inserted replaced
5672:6ba79753bdd4 5673:dec5ac461e93
104 return AVERROR(EIO); 104 return AVERROR(EIO);
105 /* 1 byte header and 14 bytes worth of samples * number channels per block */ 105 /* 1 byte header and 14 bytes worth of samples * number channels per block */
106 packet_size = 15*st->codec->channels; 106 packet_size = 15*st->codec->channels;
107 107
108 ret = av_get_packet(pb, pkt, packet_size); 108 ret = av_get_packet(pb, pkt, packet_size);
109 if(ret != packet_size) 109 if(ret < 0)
110 return AVERROR(EIO); 110 return ret;
111 111
112 pkt->stream_index = st->index; 112 pkt->stream_index = st->index;
113 xa->sent_bytes += packet_size; 113 xa->sent_bytes += packet_size;
114 pkt->pts = xa->audio_frame_counter; 114 pkt->pts = xa->audio_frame_counter;
115 /* 14 bytes Samples per channel with 2 samples per byte */ 115 /* 14 bytes Samples per channel with 2 samples per byte */