[SCM] libav/wheezy-security: alac: Limit max_samples_per_frame
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 1 21:36:14 UTC 2014
The following commit has been merged in the wheezy-security branch:
commit 110680c5a2098505400f4fdff4c994020a377d19
Author: Martin Storsjö <martin at martin.st>
Date: Tue Sep 3 11:54:03 2013 +0300
alac: Limit max_samples_per_frame
Otherwise buffer size calculations in allocate_buffers could
overflow later, making the code think a large enough buffer
actually was allocated.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index da78908..23b8951 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -584,6 +584,12 @@ static int alac_set_info(ALACContext *alac)
/* buffer size / 2 ? */
alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);
+ if (!alac->setinfo_max_samples_per_frame ||
+ alac->setinfo_max_samples_per_frame > INT_MAX / sizeof(int32_t)) {
+ av_log(alac->avctx, AV_LOG_ERROR, "max samples per frame invalid: %u\n",
+ alac->setinfo_max_samples_per_frame);
+ return AVERROR_INVALIDDATA;
+ }
ptr++; /* compatible version */
alac->setinfo_sample_size = *ptr++;
alac->setinfo_rice_historymult = *ptr++;
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list