[FFmpeg-cvslog] hqx: correct type and size check of info_offset
Andreas Cadhalpun
git at videolan.org
Sun Nov 22 15:39:35 CET 2015
ffmpeg | branch: master | Andreas Cadhalpun <andreas.cadhalpun at gmail.com> | Sun Nov 15 10:50:44 2015 +0100| [9fd2bf09dbc630484d9e88a1d27f7e8508b70a2c] | committer: Vittorio Giovara
hqx: correct type and size check of info_offset
It is used as size argument of ff_canopus_parse_info_tag, which uses it
as size argument to bytestream2_init, which only supports sizes up to
INT_MAX.
Changing it's type to unsigned simplifies the check.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fd2bf09dbc630484d9e88a1d27f7e8508b70a2c
---
libavcodec/hqx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index 34e3605..7411d3f 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -417,8 +417,8 @@ static int hqx_decode_frame(AVCodecContext *avctx, void *data,
info_tag = AV_RL32(src);
if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
- int info_offset = AV_RL32(src + 4);
- if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) {
+ unsigned info_offset = AV_RL32(src + 4);
+ if (info_offset > INT_MAX || info_offset + 8 > avpkt->size) {
av_log(avctx, AV_LOG_ERROR,
"Invalid INFO header offset: 0x%08"PRIX32" is too large.\n",
info_offset);
More information about the ffmpeg-cvslog
mailing list