Skip to content

Commit

Permalink
targa: prevent integer overflow in bufsize check.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbultje committed Feb 21, 2011
1 parent b3db9ce commit 78e2380
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/targa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
} \
Expand Down

0 comments on commit 78e2380

Please sign in to comment.