ffmpeg | branch: master | Carl Eugen Hoyos <[email protected]> | 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;
             }

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to