mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-04 14:22:12 +00:00
Use bytestream_get_le16 to simplify offset/count calculation for mszh decompression.
Originally committed as revision 19051 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5a18221ba8
commit
2bee59083d
@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
|
#include "bytestream.h"
|
||||||
#include "lcl.h"
|
#include "lcl.h"
|
||||||
|
|
||||||
#if CONFIG_ZLIB_DECODER
|
#if CONFIG_ZLIB_DECODER
|
||||||
@ -96,10 +97,8 @@ static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned cha
|
|||||||
destptr += 4;
|
destptr += 4;
|
||||||
srcptr += 4;
|
srcptr += 4;
|
||||||
} else {
|
} else {
|
||||||
ofs = *srcptr++;
|
ofs = bytestream_get_le16(&srcptr);
|
||||||
cnt = *srcptr++;
|
cnt = (ofs >> 11) + 1;
|
||||||
ofs += cnt * 256;
|
|
||||||
cnt = (cnt >> 3) + 1;
|
|
||||||
ofs &= 0x7ff;
|
ofs &= 0x7ff;
|
||||||
cnt *= 4;
|
cnt *= 4;
|
||||||
if (destptr_end - destptr < cnt) {
|
if (destptr_end - destptr < cnt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user