Commit b4466c9c authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

oggparsedaala: check number of planes in pixel format map

This fixes crashes caused by out-of-bounds writes.
Reviewed-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 4a44bc55
......@@ -130,6 +130,12 @@ static int daala_header(AVFormatContext *s, int idx)
hdr->fpr = bytestream2_get_byte(&gb);
hdr->format.planes = bytestream2_get_byte(&gb);
if (hdr->format.planes > 4) {
av_log(s, AV_LOG_ERROR,
"Invalid number of planes %d in daala pixel format map.\n",
hdr->format.planes);
return AVERROR_INVALIDDATA;
}
for (i = 0; i < hdr->format.planes; i++) {
hdr->format.xdec[i] = bytestream2_get_byte(&gb);
hdr->format.ydec[i] = bytestream2_get_byte(&gb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment