1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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>
This commit is contained in:
Paul B Mahol 2012-03-26 02:01:23 +00:00 committed by Michael Niedermayer
parent 67d5fcc989
commit 02fb320ada

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