[FFmpeg-devel] [PATCH 04/19] snowdec: fix return value for small overreads.

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


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

diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index f3d4656..7ebe7d9 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -557,6 +557,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
 
     bytes_read= c->bytestream - c->bytestream_start;
     if(bytes_read ==0) av_log(s->avctx, AV_LOG_ERROR, "error at end of frame\n"); //FIXME
+    if (bytes_read > avpkt->size && bytes_read <= avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE)
+        bytes_read = avpkt->size; /* small overreads are acceptable */
 
     return bytes_read;
 }
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list