[FFmpeg-cvslog] r25931 - trunk/libavformat/asfdec.c
reimar
subversion
Sat Dec 11 22:41:47 CET 2010
Author: reimar
Date: Sat Dec 11 22:41:47 2010
New Revision: 25931
Log:
Return an error when get_buffer reads none or only partial data instead
of returning packets with uninitialized data.
Returning partial packets as for other demuxers is problematice due to
packet scrambling and thus is not done.
Modified:
trunk/libavformat/asfdec.c
Modified: trunk/libavformat/asfdec.c
==============================================================================
--- trunk/libavformat/asfdec.c Sat Dec 11 22:39:08 2010 (r25930)
+++ trunk/libavformat/asfdec.c Sat Dec 11 22:41:47 2010 (r25931)
@@ -848,6 +848,7 @@ static int ff_asf_parse_packet(AVFormatC
ASFContext *asf = s->priv_data;
ASFStream *asf_st = 0;
for (;;) {
+ int ret;
if(url_feof(pb))
return AVERROR_EOF;
if (asf->packet_size_left < FRAME_HEADER_SIZE
@@ -950,8 +951,10 @@ static int ff_asf_parse_packet(AVFormatC
continue;
}
- get_buffer(pb, asf_st->pkt.data + asf->packet_frag_offset,
- asf->packet_frag_size);
+ ret = get_buffer(pb, asf_st->pkt.data + asf->packet_frag_offset,
+ asf->packet_frag_size);
+ if (ret != asf->packet_frag_size)
+ return ret >= 0 ? AVERROR_EOF : ret;
if (s->key && s->keylen == 20)
ff_asfcrypt_dec(s->key, asf_st->pkt.data + asf->packet_frag_offset,
asf->packet_frag_size);
More information about the ffmpeg-cvslog
mailing list