[FFmpeg-cvslog] r25930 - trunk/libavformat/asfdec.c

reimar subversion
Sat Dec 11 22:39:08 CET 2010


Author: reimar
Date: Sat Dec 11 22:39:08 2010
New Revision: 25930

Log:
Ensure that packets returned from ASF demuxer are properly 0-padded.

Modified:
   trunk/libavformat/asfdec.c

Modified: trunk/libavformat/asfdec.c
==============================================================================
--- trunk/libavformat/asfdec.c	Sat Dec 11 22:34:50 2010	(r25929)
+++ trunk/libavformat/asfdec.c	Sat Dec 11 22:39:08 2010	(r25930)
@@ -977,9 +977,10 @@ static int ff_asf_parse_packet(AVFormatC
                     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;



More information about the ffmpeg-cvslog mailing list