mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
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/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b0a718923bb4a75b0c1cbf283fb17a319b840346) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
97de004ad9
commit
9f9cedf29f
@ -677,8 +677,11 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
break;
|
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;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
buf += segment_length;
|
buf += segment_length;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user