changeset 1141:ef9bf68071d3 libavformat

extradata may be used as bitstream reader input so allocate with padding
author mru
date Thu, 29 Jun 2006 19:42:34 +0000
parents 2cfb5e02b299
children e3a585883bbd
files utils.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Thu Jun 29 19:03:53 2006 +0000
+++ b/utils.c	Thu Jun 29 19:42:34 2006 +0000
@@ -1995,8 +1995,9 @@
             int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
             if(i){
                 st->codec->extradata_size= i;
-                st->codec->extradata= av_malloc(st->codec->extradata_size);
+                st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
                 memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
+                memset(st->codec->extradata + i, 0, FF_INPUT_BUFFER_PADDING_SIZE);
             }
         }