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

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/sanm.c+5−0
@@ -1601,6 +1601,11 @@ static int old_codec48(SANMVideoContext *ctx, int width, int height) · 1600 unmodified lines
1601 }1601 }
1602 break;1602 break;
1603 case 2:1603 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
1604 if (rle_decode(ctx, &ctx->gb, dst, decoded_size))1609 if (rle_decode(ctx, &ctx->gb, dst, decoded_size))
1605 return AVERROR_INVALIDDATA;1610 return AVERROR_INVALIDDATA;
1606 break;1611 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