[FFmpeg-cvslog] smacker: fix off-by-one error in palette expanding code

Kostya Shishkov git at videolan.org
Tue May 28 08:08:29 CEST 2013


ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Mon May 27 06:26:28 2013 +0200| [c3c08baefbf8c9b19c9c1f1bd7a899b697422eea] | committer: Kostya Shishkov

smacker: fix off-by-one error in palette expanding code

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

 libavformat/smacker.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 17c7c52..e144243 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -274,7 +274,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 > 0x100) {
                         av_log(s, AV_LOG_ERROR,
                                "Invalid palette update, offset=%d length=%d extends beyond palette size\n",
                                off, j);



More information about the ffmpeg-cvslog mailing list