diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 80e2fa694e..b2c442e2d8 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -263,7 +263,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) } else if(t & 0x40){ /* copy with offset */ off = avio_r8(s->pb); j = (t & 0x3F) + 1; - if (off + j > 0xff) { + if (off + j - 1 > 0xff) { av_log(s, AV_LOG_ERROR, "Invalid palette update, offset=%d length=%d extends beyond palette size\n", off, j);