[FFmpeg-cvslog] avcodec/pgssubdec: Always return error upon allocation error

Andreas Rheinhardt git at videolan.org
Thu Dec 16 04:01:49 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Dec 10 16:10:06 2021 +0100| [200a3728373fbc74cbfdfcbb3d2152cf21d17034] | committer: Andreas Rheinhardt

avcodec/pgssubdec: Always return error upon allocation error

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=200a3728373fbc74cbfdfcbb3d2152cf21d17034
---

 libavcodec/pgssubdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;



More information about the ffmpeg-cvslog mailing list