[SCM] libav/experimental: Make the ugly hack which uses an unused entry in the internal buffer array actually use a unused one, so it does work.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:25:36 UTC 2013


The following commit has been merged in the experimental branch:
commit 6ebc89ac484bd32bd8650a927b1132c22336659e
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Sat Jul 19 00:32:15 2008 +0000

    Make the ugly hack which uses an unused entry in the internal buffer
    array actually use a unused one, so it does work.
    
    Originally committed as revision 14286 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b3d9b36..fd160de 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -195,7 +195,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
         return -1;
 
     if(s->internal_buffer==NULL){
-        s->internal_buffer= av_mallocz(INTERNAL_BUFFER_SIZE*sizeof(InternalBuffer));
+        s->internal_buffer= av_mallocz((INTERNAL_BUFFER_SIZE+1)*sizeof(InternalBuffer));
     }
 #if 0
     s->internal_buffer= av_fast_realloc(
@@ -206,7 +206,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
 #endif
 
     buf= &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
-    picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE-1]).last_pic_num; //FIXME ugly hack
+    picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE]).last_pic_num; //FIXME ugly hack
     (*picture_number)++;
 
     if(buf->base[0] && (buf->width != w || buf->height != h || buf->pix_fmt != s->pix_fmt)){

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list