Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-12-30 13:42:55 +0400
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-12-31 19:31:15 +0400
commit42a1f1d7a8cf67eed68db596d6a1e53c0c36e4ab (patch)
tree0277bc963343cfe4268b33097c49b920ab2cba47 /libavcodec/lcldec.c
parent4962edf88926ae2b06260eb50dbc96dcd4199784 (diff)
Avoid uninitialized data in lcldec when ofs is 0 in MSZH.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/lcldec.c')
-rw-r--r--libavcodec/lcldec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index e288fc3f63..57b04f79f1 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -96,7 +96,13 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
ofs = FFMIN(ofs, destptr - destptr_bak);
cnt *= 4;
cnt = FFMIN(cnt, destptr_end - destptr);
- av_memcpy_backptr(destptr, ofs, cnt);
+ if (ofs) {
+ av_memcpy_backptr(destptr, ofs, cnt);
+ } else {
+ // Not known what the correct behaviour is, but
+ // this at least avoids uninitialized data.
+ memset(destptr, 0, cnt);
+ }
destptr += cnt;
}
maskbit >>= 1;