Browse Source

avcodec/pngdec: set return value on av_stereo3d_create_side_data() failure

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
tags/n4.3
Peter Ross 5 years ago
parent
commit
55d830f69a
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/pngdec.c

+ 3
- 1
libavcodec/pngdec.c View File

@@ -1286,8 +1286,10 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
case MKTAG('s', 'T', 'E', 'R'): { case MKTAG('s', 'T', 'E', 'R'): {
int mode = bytestream2_get_byte(&s->gb); int mode = bytestream2_get_byte(&s->gb);
AVStereo3D *stereo3d = av_stereo3d_create_side_data(p); AVStereo3D *stereo3d = av_stereo3d_create_side_data(p);
if (!stereo3d)
if (!stereo3d) {
ret = AVERROR(ENOMEM);
goto fail; goto fail;
}


if (mode == 0 || mode == 1) { if (mode == 0 || mode == 1) {
stereo3d->type = AV_STEREO3D_SIDEBYSIDE; stereo3d->type = AV_STEREO3D_SIDEBYSIDE;


Loading…
Cancel
Save