diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-02-21 13:44:37 -0500 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-22 02:44:37 +0100 |
commit | e48fe14a54d8360336dbb22f3f787815b57dda47 (patch) | |
tree | df37df4dc86220524ec16e1257be26fdd34e288d /libavcodec/targa.c | |
parent | d4e321d9c2f52f77e06ca48c3ddf71f8d4219f7b (diff) | |
download | ffmpeg-streaming-e48fe14a54d8360336dbb22f3f787815b57dda47.zip ffmpeg-streaming-e48fe14a54d8360336dbb22f3f787815b57dda47.tar.gz |
targa: prevent integer overflow in bufsize check.
(cherry picked from commit 78e2380a6d09e7a8b2a74d090abfb0a922e046f6)
Diffstat (limited to 'libavcodec/targa.c')
-rw-r--r-- | libavcodec/targa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 0892b6f..3c220f4 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -34,7 +34,7 @@ typedef struct TargaContext { } TargaContext; #define CHECK_BUFFER_SIZE(buf, buf_end, needed, where) \ - if(buf + needed > buf_end){ \ + if(needed > buf_end - buf){ \ av_log(avctx, AV_LOG_ERROR, "Problem: unexpected end of data while reading " where "\n"); \ return -1; \ } \ |