Module: libav
Branch: release/0.8
Commit: 9fba59f471725e5235d5378e795ebf8b59472817

Author:    Michael Niedermayer <mich...@niedermayer.cc>
Committer: Diego Biurrun <di...@biurrun.de>
Date:      Sun Nov 15 14:52:08 2015 +0100

smacker: Check that the data size is a multiple of a sample vector

Fixes out of array access
Fixes: 
ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk

Bug-Id: CVE-2015-8365
CC: libav-sta...@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit 4a9af07a49295e014b059c1ab624c40345af5892)
Signed-off-by: Diego Biurrun <di...@biurrun.de>
(cherry picked from commit b98f082d8ddc0a0d8317114d8414ab51de60ef02)
Signed-off-by: Diego Biurrun <di...@biurrun.de>

---

 libavcodec/smacker.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index bce23f4..d2a612c 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -634,6 +634,11 @@ static int smka_decode_frame(AVCodecContext *avctx, void 
*data,
         av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n");
         return AVERROR(EINVAL);
     }
+    if (unp_size % (avctx->channels * (bits + 1))) {
+        av_log(avctx, AV_LOG_ERROR,
+               "The buffer does not contain an integer number of samples\n");
+        return AVERROR(EINVAL);
+    }
 
     /* get output buffer */
     s->frame.nb_samples = unp_size / (avctx->channels * (bits + 1));

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to