diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-12-11 21:39:08 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-12-11 21:39:08 +0000 |
commit | 3c3ef81b9b17c992bbff9b521d871c8c250ae53c (patch) | |
tree | 1f826b8ac5b1de4937d247847de758b4b449fff9 | |
parent | b72daad0621f46719723f5b93bf9924b52c76ce5 (diff) | |
download | ffmpeg-3c3ef81b9b17c992bbff9b521d871c8c250ae53c.tar.gz |
Ensure that packets returned from ASF demuxer are properly 0-padded.
Originally committed as revision 25930 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/asfdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 59f670bf45..6918e20123 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -977,9 +977,10 @@ static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket * av_log(s, AV_LOG_ERROR, "pkt.size != ds_packet_size * ds_span (%d %d %d)\n", asf_st->pkt.size, asf_st->ds_packet_size, asf_st->ds_span); }else{ /* packet descrambling */ - uint8_t *newdata = av_malloc(asf_st->pkt.size); + uint8_t *newdata = av_malloc(asf_st->pkt.size + FF_INPUT_BUFFER_PADDING_SIZE); if (newdata) { int offset = 0; + memset(newdata + asf_st->pkt.size, 0, FF_INPUT_BUFFER_PADDING_SIZE); while (offset < asf_st->pkt.size) { int off = offset / asf_st->ds_chunk_size; int row = off / asf_st->ds_span; |