mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/jpeg2000dec: fix error detection in pix_fmt_match()
Fixes out of array accesses with CODEC_FLAG_EMU_EDGE Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
723e7b86ea
commit
8001e9f7d1
|
@ -344,7 +344,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) {
|
if (i == possible_fmts_nb) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR,
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
"Unknown pix_fmt, profile: %d, colour_space: %d, "
|
"Unknown pix_fmt, profile: %d, colour_space: %d, "
|
||||||
"components: %d, precision: %d, "
|
"components: %d, precision: %d, "
|
||||||
|
@ -354,6 +354,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
|
||||||
ncomponents > 2 ? s->cdy[1] : 0,
|
ncomponents > 2 ? s->cdy[1] : 0,
|
||||||
ncomponents > 2 ? s->cdx[2] : 0,
|
ncomponents > 2 ? s->cdx[2] : 0,
|
||||||
ncomponents > 2 ? s->cdy[2] : 0);
|
ncomponents > 2 ? s->cdy[2] : 0);
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
s->avctx->bits_per_raw_sample = s->precision;
|
s->avctx->bits_per_raw_sample = s->precision;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue