summaryrefslogtreecommitdiff
path: root/libavformat/omadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-24 15:24:25 +0200
committerAnton Khirnov <anton@khirnov.net>2013-11-04 18:43:03 +0100
commit1c736bedd9891501960ebac0f7c05eb60225e947 (patch)
tree1dcae8356cb3438fb6790a2f8337ba316e706efb /libavformat/omadec.c
parent97f50e92b5cf3b47a76f75d76ed4340e822030db (diff)
omadec: check GEOB sizes against buffer size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: David Goldwich <david.goldwich@gmail.com> CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/omadec.c')
-rw-r--r--libavformat/omadec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 98ccbdef9f..eeab70ea0c 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -237,6 +237,11 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
return AVERROR_INVALIDDATA;
}
+ 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);