Commit 0ad04bf6 authored by wm4's avatar wm4 Committed by 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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b06e82e7
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment