[FFmpeg-cvslog] lavc/qdrw: Fix overwrite when reading invalid Quickdraw images.
Carl Eugen Hoyos
git at videolan.org
Sun May 17 03:05:02 CEST 2015
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat May 16 22:51:16 2015 +0200| [1eda55510ae5d15ce3df9f496002508580899045] | committer: Carl Eugen Hoyos
lavc/qdrw: Fix overwrite when reading invalid Quickdraw images.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1eda55510ae5d15ce3df9f496002508580899045
---
libavcodec/qdrw.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 6c920aa..0bcf5dc 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -95,6 +95,8 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
pos -= offset;
pos++;
}
+ if (pos >= offset)
+ return AVERROR_INVALIDDATA;
}
left -= 2;
} else { /* copy */
@@ -105,6 +107,8 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
pos -= offset;
pos++;
}
+ if (pos >= offset)
+ return AVERROR_INVALIDDATA;
}
left -= 2 + code;
}
More information about the ffmpeg-cvslog
mailing list