summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/dvdsubdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 673fc6051e..a87a3bcdd4 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);