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>
(cherry picked from commit 1c736bedd9)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
committed by
Reinhard Tartler
parent
e776a1e8f3
commit
cdc47c4813
@@ -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");
|
av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
|
||||||
return -1;
|
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]);
|
oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
|
||||||
av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
|
av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user