diff mbox series

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

Message ID 3d8850d7a6e1cdfdc05ebaabd160f26e42951503.1587127045.git.pross@xvid.org
State Accepted
Commit 55d830f69a2ff3ca191d97862200d4cc480d25b7
Headers show
Series [FFmpeg-devel] avcodec/pngdec: set return value on av_stereo3d_create_side_data() failure
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Peter Ross April 17, 2020, 12:37 p.m. UTC
---
 libavcodec/pngdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vittorio Giovara April 17, 2020, 3:36 p.m. UTC | #1
On Fri, Apr 17, 2020 at 8:37 AM Peter Ross <pross@xvid.org> wrote:

> ---
>  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
>

lgtm
diff mbox series

Patch

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;