Commit 02fb320a authored by Paul B Mahol's avatar Paul B Mahol Committed by Michael Niedermayer

libopenjpegdec: always check image because decoding may still fail

Fixes bunch of segfaults.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 67d5fcc9
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment