[FFmpeg-cvslog] jpeglsdec: Prevent out of array write.
Michael Niedermayer
git at videolan.org
Fri Mar 16 20:06:58 CET 2012
ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Mon Feb 13 23:50:35 2012 +0100| [001f4c7dc63e90e719187cd7f961c8220721878f] | committer: Michael Niedermayer
jpeglsdec: Prevent out of array write.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 00ab9cdae1a96dfea33cd505076a83823f390aa4)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=001f4c7dc63e90e719187cd7f961c8220721878f
---
libavcodec/jpeglsdec.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 0139c88..74714e0 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -198,6 +198,9 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
r = ff_log2_run[state->run_index[comp]];
if(r)
r = get_bits_long(&s->gb, r);
+ if(x + r * stride > w) {
+ r = (w - x) / stride;
+ }
for(i = 0; i < r; i++) {
W(dst, x, Ra);
x += stride;
More information about the ffmpeg-cvslog
mailing list