Commit b0a71892 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pgssubdec: Free subtitle on error

Fixes: Assertion failure
Fixes: 19753/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGSSUB_fuzzer-5688461843759104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8aa3c09c
......@@ -691,8 +691,11 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
ret = AVERROR_INVALIDDATA;
break;
}
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) {
avsubtitle_free(data);
*data_size = 0;
return ret;
}
buf += segment_length;
}
......
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