Commit 4bc3008d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeglsdec: Check get_bits_left() before decoding a picture

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 11827ea3
......@@ -390,6 +390,10 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
av_log(s->avctx, AV_LOG_DEBUG, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n",
ilv, point_transform, s->bits, s->cur_scan);
}
if (get_bits_left(&s->gb) < s->height) {
ret = AVERROR_INVALIDDATA;
goto end;
}
if (ilv == 0) { /* separate planes */
if (s->cur_scan > s->nb_components) {
ret = AVERROR_INVALIDDATA;
......
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