mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-30 07:08:22 +00: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:
parent
67d5fcc989
commit
02fb320ada
@ -295,6 +295,11 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
|
|||||||
// Decode the codestream
|
// Decode the codestream
|
||||||
image = opj_decode_with_info(dec, stream, NULL);
|
image = opj_decode_with_info(dec, stream, NULL);
|
||||||
opj_cio_close(stream);
|
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;
|
pixel_size = av_pix_fmt_descriptors[avctx->pix_fmt].comp[0].step_minus1 + 1;
|
||||||
ispacked = libopenjpeg_ispacked(avctx->pix_fmt);
|
ispacked = libopenjpeg_ispacked(avctx->pix_fmt);
|
||||||
|
Loading…
Reference in New Issue
Block a user