]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/pngdec: set return value on av_stereo3d_create_side_data() failure
authorPeter Ross <pross@xvid.org>
Fri, 17 Apr 2020 12:35:43 +0000 (22:35 +1000)
committerPeter Ross <pross@xvid.org>
Sat, 18 Apr 2020 00:16:55 +0000 (10:16 +1000)
Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/pngdec.c

index 7e2c19bd57e39e77c38525f9602838bfa728ba53..12d4eb0610dc98372a4630d3591f55f7c9eceefd 100644 (file)
@@ -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;