[FFmpeg-cvslog] smacker: fix off by one error

Paul B Mahol git at videolan.org
Wed Apr 3 15:34:48 CEST 2013


ffmpeg | branch: release/0.11 | Paul B Mahol <onemda at gmail.com> | Wed Apr  3 12:57:58 2013 +0000| [708101c6f5c5205f9494363acfe0e92671117263] | committer: Carl Eugen Hoyos

smacker: fix off by one error

Regression since a93b572ae4f517ce0c35cf085167c318e9215908.

Fixes #2426.

Signed-off-by: Paul B Mahol <onemda at gmail.com>
(cherry picked from commit e3cc92a623a6ece42816c7a692c8815688a99ab0)

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

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

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 84a53ea..dd4418c 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -269,7 +269,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);



More information about the ffmpeg-cvslog mailing list