[FFmpeg-cvslog] targadec: Simplify RLE out of packet check.

Michael Niedermayer git at videolan.org
Sat Jan 28 01:51:40 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 21 04:36:06 2012 +0100| [eb3f81e4ef73bb8d7e2c75ff0e8cb43de1c7dac5] | committer: Michael Niedermayer

targadec: Simplify RLE out of packet check.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eb3f81e4ef73bb8d7e2c75ff0e8cb43de1c7dac5
---

 libavcodec/targa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 56e02c1..573992f 100644
--- a/libavcodec/targa.c
+++ b/libavcodec/targa.c
@@ -55,7 +55,7 @@ static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s, const uint8_
         type = *src++;
         count = (type & 0x7F) + 1;
         type &= 0x80;
-        if((x + count > w) && (x + count + 1 > (h - y) * w)){
+        if(x + count > (h - y) * w){
             av_log(avctx, AV_LOG_ERROR, "Packet went out of bounds: position (%i,%i) size %i\n", x, y, count);
             return -1;
         }



More information about the ffmpeg-cvslog mailing list