comparison lcldec.c @ 9781:05b6cba2c95b libavcodec

lcldec: ensure that the offset for av_memcpy_backptr is valid.
author reimar
date Sun, 31 May 2009 17:44:35 +0000
parents 9f3ef4eea41a
children 66922728d7f7
comparison
equal deleted inserted replaced
9780:9f3ef4eea41a 9781:05b6cba2c95b
91 srcptr += 4; 91 srcptr += 4;
92 } else { 92 } else {
93 unsigned ofs = bytestream_get_le16(&srcptr); 93 unsigned ofs = bytestream_get_le16(&srcptr);
94 unsigned cnt = (ofs >> 11) + 1; 94 unsigned cnt = (ofs >> 11) + 1;
95 ofs &= 0x7ff; 95 ofs &= 0x7ff;
96 ofs = FFMIN(ofs, destptr - destptr_bak);
96 cnt *= 4; 97 cnt *= 4;
97 cnt = FFMIN(cnt, destptr_end - destptr); 98 cnt = FFMIN(cnt, destptr_end - destptr);
98 av_memcpy_backptr(destptr, ofs, cnt); 99 av_memcpy_backptr(destptr, ofs, cnt);
99 destptr += cnt; 100 destptr += cnt;
100 } 101 }