[FFmpeg-devel] [PATCH] Avoid uninitialized data in lcldec when ofs is 0 in MSZH.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Fri Dec 30 10:46:10 CET 2011
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
libavcodec/lcldec.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index e288fc3..57b04f7 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;
--
1.7.8.1
More information about the ffmpeg-devel
mailing list