[FFmpeg-devel] [PATCH] avcodec/pngdec: set return value on av_stereo3d_create_side_data() failure

Peter Ross pross at xvid.org
Fri Apr 17 15:37:37 EEST 2020


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

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 7e2c19bd57..12d4eb0610 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1286,8 +1286,10 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
         case MKTAG('s', 'T', 'E', 'R'): {
             int mode = bytestream2_get_byte(&s->gb);
             AVStereo3D *stereo3d = av_stereo3d_create_side_data(p);
-            if (!stereo3d)
+            if (!stereo3d) {
+                ret = AVERROR(ENOMEM);
                 goto fail;
+            }
 
             if (mode == 0 || mode == 1) {
                 stereo3d->type  = AV_STEREO3D_SIDEBYSIDE;
-- 
2.20.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200417/187c4a7c/attachment.sig>


More information about the ffmpeg-devel mailing list