You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lagarith: check count before writing zeros.
Fixes CVE-2012-2793 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
committed by
Anton Khirnov
parent
99f392a584
commit
b631e4ed64
@@ -361,6 +361,11 @@ static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst,
|
|||||||
output_zeros:
|
output_zeros:
|
||||||
if (l->zeros_rem) {
|
if (l->zeros_rem) {
|
||||||
count = FFMIN(l->zeros_rem, width - i);
|
count = FFMIN(l->zeros_rem, width - i);
|
||||||
|
if (end - dst < count) {
|
||||||
|
av_log(l->avctx, AV_LOG_ERROR, "Too many zeros remaining.\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
memset(dst, 0, count);
|
memset(dst, 0, count);
|
||||||
l->zeros_rem -= count;
|
l->zeros_rem -= count;
|
||||||
dst += count;
|
dst += count;
|
||||||
|
Reference in New Issue
Block a user