diff mbox series

[FFmpeg-devel,05/12] avcodec/pgssubdec: Always return error upon allocation error

Message ID AM7PR03MB666035A36E9842682282CB168F729@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 200a3728373fbc74cbfdfcbb3d2152cf21d17034
Headers show
Series [FFmpeg-devel,01/12] avcodec/h2645_parse: Remove H2645NAL.rbsp_buffer | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 11, 2021, 6:40 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/pgssubdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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;