mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-15 02:58:01 +00:00
vqavideo: check for out of bound reads.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6d45702f7f257c1cfcd3ce3287bf258854528a4a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b832e539c0
commit
7ab0b6b7ed
@ -230,6 +230,8 @@ static void decode_format80(const unsigned char *src, int src_size,
|
||||
src_index += 2;
|
||||
av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
|
||||
CHECK_COUNT();
|
||||
if (src_pos + count > dest_size)
|
||||
return;
|
||||
for (i = 0; i < count; i++)
|
||||
dest[dest_index + i] = dest[src_pos + i];
|
||||
dest_index += count;
|
||||
@ -252,6 +254,8 @@ static void decode_format80(const unsigned char *src, int src_size,
|
||||
src_index += 2;
|
||||
av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
|
||||
CHECK_COUNT();
|
||||
if (src_pos + count > dest_size)
|
||||
return;
|
||||
for (i = 0; i < count; i++)
|
||||
dest[dest_index + i] = dest[src_pos + i];
|
||||
dest_index += count;
|
||||
@ -272,6 +276,8 @@ static void decode_format80(const unsigned char *src, int src_size,
|
||||
src_index += 2;
|
||||
av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
|
||||
CHECK_COUNT();
|
||||
if (dest_index < src_pos)
|
||||
return;
|
||||
for (i = 0; i < count; i++)
|
||||
dest[dest_index + i] = dest[dest_index - src_pos + i];
|
||||
dest_index += count;
|
||||
|
Loading…
Reference in New Issue
Block a user