summaryrefslogtreecommitdiff
path: root/libavcodec/pgssubdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-10 16:10:06 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-16 02:37:26 +0100
commit200a3728373fbc74cbfdfcbb3d2152cf21d17034 (patch)
tree29878f6afd88d866df8bead0c9d8ac868a1d72d4 /libavcodec/pgssubdec.c
parent97e26937b46323fc85480d32123d5d4f1fcd7832 (diff)
downloadffmpeg-200a3728373fbc74cbfdfcbb3d2152cf21d17034.tar.gz
avcodec/pgssubdec: Always return error upon allocation error
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/pgssubdec.c')
-rw-r--r--libavcodec/pgssubdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 388639a110..2d5700a51e 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -677,7 +677,8 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub_ptr,
ret = AVERROR_INVALIDDATA;
break;
}
- if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) {
+ if (ret < 0 && (ret == AVERROR(ENOMEM) ||
+ avctx->err_recognition & AV_EF_EXPLODE)) {
avsubtitle_free(data);
*got_sub_ptr = 0;
return ret;