mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-05 01:51:53 +02:00
lagarith: check count before writing zeros.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
56dcfe87ef
commit
83c7803f55
@ -326,6 +326,10 @@ 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user