[FFmpeg-devel] [PATCH 02/19] mmvideo: count preamble size in return value.

Nicolas George nicolas.george at normalesup.org
Sun Jul 29 15:57:20 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavcodec/mmvideo.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


MM_PREAMBLE_SIZE is substracted to buf_size almost immediately.


diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index abba29f..de702ab 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -178,6 +178,7 @@ static int mm_decode_frame(AVCodecContext *avctx,
 {
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
+    int buf_size_orig = buf_size;
     MmContext *s = avctx->priv_data;
     int type, res;
 
@@ -194,7 +195,7 @@ static int mm_decode_frame(AVCodecContext *avctx,
     }
 
     switch(type) {
-    case MM_TYPE_PALETTE   : res = mm_decode_pal(s); return buf_size;
+    case MM_TYPE_PALETTE   : res = mm_decode_pal(s); return buf_size_orig;
     case MM_TYPE_INTRA     : res = mm_decode_intra(s, 0, 0); break;
     case MM_TYPE_INTRA_HH  : res = mm_decode_intra(s, 1, 0); break;
     case MM_TYPE_INTRA_HHV : res = mm_decode_intra(s, 1, 1); break;
@@ -213,7 +214,7 @@ static int mm_decode_frame(AVCodecContext *avctx,
     *data_size = sizeof(AVFrame);
     *(AVFrame*)data = s->frame;
 
-    return buf_size;
+    return buf_size_orig;
 }
 
 static av_cold int mm_decode_end(AVCodecContext *avctx)
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list