Browse Source

libopenjpegdec: always check image because decoding may still fail

Fixes bunch of segfaults.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Paul B Mahol Michael Niedermayer 14 years ago
parent
commit
02fb320ada
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/libopenjpegdec.c

+ 5
- 0
libavcodec/libopenjpegdec.c View File

@@ -295,6 +295,11 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
// Decode the codestream
image = opj_decode_with_info(dec, stream, NULL);
opj_cio_close(stream);
if(!image) {
av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n");
opj_destroy_decompress(dec);
return -1;
}

pixel_size = av_pix_fmt_descriptors[avctx->pix_fmt].comp[0].step_minus1 + 1;
ispacked = libopenjpeg_ispacked(avctx->pix_fmt);


Loading…
Cancel
Save