Module: libav
Branch: release/9
Commit: cdc47c48137fd5eb2e8195a005b6d59480b4d570

Author:    Michael Niedermayer <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Thu Oct 24 15:24:25 2013 +0200

omadec: check GEOB sizes against buffer size

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <[email protected]>
CC:[email protected]
Signed-off-by: Anton Khirnov <[email protected]>
(cherry picked from commit 1c736bedd9891501960ebac0f7c05eb60225e947)
Signed-off-by: Reinhard Tartler <[email protected]>

---

 libavformat/omadec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 0403451..158e1a6 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -234,6 +234,11 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta 
*em, uint8_t *header)
         av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
         return -1;
     }
+    if (OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size + 8 > 
geob->datasize ||
+        OMA_ENC_HEADER_SIZE + 48 > geob->datasize) {
+        av_log(s, AV_LOG_ERROR, "Too little GEOB data\n");
+        return AVERROR_INVALIDDATA;
+    }
     oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
     av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
 

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to