[FFmpeg-cvslog] r14286 - trunk/libavcodec/utils.c

michael subversion
Sat Jul 19 02:32:16 CEST 2008


Author: michael
Date: Sat Jul 19 02:32:15 2008
New Revision: 14286

Log:
Make the ugly hack which uses an unused entry in the internal buffer
array actually use a unused one, so it does work.


Modified:
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Sat Jul 19 02:32:15 2008
@@ -195,7 +195,7 @@ int avcodec_default_get_buffer(AVCodecCo
         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(AVCodecCo
 #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)){




More information about the ffmpeg-cvslog mailing list