History

avcodec/sanm: Check decoded_size for old_codec48

Fixes: writing over the end of the array Fixes: BIGSLEEP-434637586/payload Regression since: b22ce90d42

Michael Niedermayer committed 1 year ago

Commit 3ccd7d81 parent 5f24c501 file · +5 −0Browse files

Unified · Split

libavcodec/sanm.c+5−0
@@ -1601,6 +1601,11 @@ static int old_codec48(SANMVideoContext *ctx, int width, int height) · 1600 unmodified lines
16011601 }
16021602 break;
16031603 case 2:
1604+ if (decoded_size > ctx->buf_size) {
1605+ av_log(ctx->avctx, AV_LOG_ERROR, "Decoded size %u is too large.\n", decoded_size);
1606+ return AVERROR_INVALIDDATA;
1607+ }
1608+
16041609 if (rle_decode(ctx, &ctx->gb, dst, decoded_size))
16051610 return AVERROR_INVALIDDATA;
16061611 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t