diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-05-31 17:44:35 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-05-31 17:44:35 +0000 |
commit | a7bfbe4e130779e1aefe59abbc1d93944d43bd4e (patch) | |
tree | 967422b10811a5b2657688251cada54bc91d8f35 /libavcodec/lcldec.c | |
parent | 4ec42240cad351bbd8ca619dd0f38064eeec29dd (diff) | |
download | ffmpeg-a7bfbe4e130779e1aefe59abbc1d93944d43bd4e.tar.gz |
lcldec: ensure that the offset for av_memcpy_backptr is valid.
Originally committed as revision 19067 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lcldec.c')
-rw-r--r-- | libavcodec/lcldec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 53637f2507..bc7e11d267 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -93,6 +93,7 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign unsigned ofs = bytestream_get_le16(&srcptr); unsigned cnt = (ofs >> 11) + 1; ofs &= 0x7ff; + ofs = FFMIN(ofs, destptr - destptr_bak); cnt *= 4; cnt = FFMIN(cnt, destptr_end - destptr); av_memcpy_backptr(destptr, ofs, cnt); |