[FFmpeg-cvslog] avcodec/pixlet: Reorder rlen check

Michael Niedermayer git at videolan.org
Mon Apr 10 14:13:29 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Apr  8 03:34:45 2017 +0200| [c94d551ea7b39c4e467e146cd347c407e8eb38ee] | committer: Michael Niedermayer

avcodec/pixlet: Reorder rlen check

This changes nothing but is nicer looking as this checks rlen

Maybe this helps coverity remove CID1397743

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/pixlet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index 4aa59f8f33..c4f7597866 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -173,7 +173,7 @@ static int read_low_coeffs(AVCodecContext *avctx, int16_t *dst, int size, int wi
             }
         }
 
-        if (i + rlen > size)
+        if (rlen > size - i)
             return AVERROR_INVALIDDATA;
         i += rlen;
 



More information about the ffmpeg-cvslog mailing list