mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-22 05:40:27 +08:00
avcodec/sanm: for ANIM codecs with own buffers, really check dimensions
Codec37/47/48 have their own buffers; left/top are applied after the decoding is done when copying to the main buffer. Don't add left/top to their width/height when doing checks against the established buffer sizes. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
This commit is contained in:
@@ -1838,7 +1838,7 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (((left + w > ctx->width) || (top + h > ctx->height) || (w * h > ctx->buf_size))
|
||||
if (((w > ctx->width) || (h > ctx->height) || (w * h > ctx->buf_size))
|
||||
&& (fsc || codec == 20)) {
|
||||
/* correct unexpected overly large frames: this happens
|
||||
* for instance with The Dig's sq1.san video: it has a few
|
||||
|
||||
Reference in New Issue
Block a user