mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-10 14:38:08 +00:00
avcodec/jpeglsdec: Check get_bits_left() before decoding a picture
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4bc3008d04
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6b839e9aa3
commit
ba7ea7c4b1
@ -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",
|
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);
|
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 (ilv == 0) { /* separate planes */
|
||||||
if (s->cur_scan > s->nb_components) {
|
if (s->cur_scan > s->nb_components) {
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
|
Loading…
Reference in New Issue
Block a user