[FFmpeg-cvslog] dvdsubdec: reset buffer size on invalid over-large packets

wm4 git at videolan.org
Thu May 28 16:10:08 CEST 2015


ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Thu May 28 14:30:14 2015 +0200| [0ad04bf6a29ee54374370d9fe1a6543439d6aa02] | committer: Michael Niedermayer

dvdsubdec: reset buffer size on invalid over-large packets

Otherwise it will never be reset, and remain "stuck" in this state
forever. Can happen when seeking: the decoder will receive fragments
from different file positions, which triggers the condition easily.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ad04bf6a29ee54374370d9fe1a6543439d6aa02
---

 libavcodec/dvdsubdec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 673fc60..a87a3bc 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -519,6 +519,7 @@ static int append_to_cached_buf(AVCodecContext *avctx,
     if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
         av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
                "too large SPU packets aborted.\n");
+        ctx->buf_size = 0;
         return AVERROR_INVALIDDATA;
     }
     memcpy(ctx->buf + ctx->buf_size, buf, buf_size);



More information about the ffmpeg-cvslog mailing list