[FFmpeg-devel] [PATCH 1/2] dvdsubdec: reset buffer size on invalid over-large packets

wm4 nfxjfg at googlemail.com
Thu May 28 14:16:35 CEST 2015


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.
---
These patches basically fix seeking.
---
 libavcodec/dvdsubdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 673fc60..5abf014 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -539,6 +539,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
     if (ctx->buf_size) {
         int ret = append_to_cached_buf(avctx, buf, buf_size);
         if (ret < 0) {
+            ctx->buf_size = 0;
             *data_size = 0;
             return ret;
         }
-- 
2.1.4



More information about the ffmpeg-devel mailing list