aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-16 03:15:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-15 00:16:27 +0200
commit450e4b1a60721d25f306d97062f35c9c3d7989f8 (patch)
treef820c8675007120c4d71802b86c1a5ecc222f9b9
parent3581ab6ce0754544b06f34f7875b731a5ca2e061 (diff)
downloadffmpeg-450e4b1a60721d25f306d97062f35c9c3d7989f8.tar.gz
sp5xdec: fix off by 1 error causing a crash
Fixes Ticket1633 Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit f0896a6bd94e5b45447c7d640c8e8aa95d860d7a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/sp5xdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
index 4aca0ccbd6..9a3b3f25ea 100644
--- a/libavcodec/sp5xdec.c
+++ b/libavcodec/sp5xdec.c
@@ -72,7 +72,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
recoded[j++] = buf[i];
else
- for (i = 14; i < buf_size && j < buf_size+1024-2; i++)
+ for (i = 14; i < buf_size && j < buf_size+1024-3; i++)
{
recoded[j++] = buf[i];
if (buf[i] == 0xff)