mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-11 03:32:39 +00:00
lcldec: ensure that the offset for av_memcpy_backptr is valid.
Originally committed as revision 19067 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
4ec42240ca
commit
a7bfbe4e13
@ -93,6 +93,7 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
|
|||||||
unsigned ofs = bytestream_get_le16(&srcptr);
|
unsigned ofs = bytestream_get_le16(&srcptr);
|
||||||
unsigned cnt = (ofs >> 11) + 1;
|
unsigned cnt = (ofs >> 11) + 1;
|
||||||
ofs &= 0x7ff;
|
ofs &= 0x7ff;
|
||||||
|
ofs = FFMIN(ofs, destptr - destptr_bak);
|
||||||
cnt *= 4;
|
cnt *= 4;
|
||||||
cnt = FFMIN(cnt, destptr_end - destptr);
|
cnt = FFMIN(cnt, destptr_end - destptr);
|
||||||
av_memcpy_backptr(destptr, ofs, cnt);
|
av_memcpy_backptr(destptr, ofs, cnt);
|
||||||
|
Loading…
Reference in New Issue
Block a user