Commit 8312e3fc authored by Kostya's avatar Kostya Committed by Reinhard Tartler
Browse files

Do not attempt to decode APE file with no frames

This fixes invalid reads/writes with this sample:
parent 1dac4d55
......@@ -242,6 +242,10 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
avio_seek(pb, ape->wavheaderlength, SEEK_CUR);
av_log(s, AV_LOG_ERROR, "No frames in the file!\n");
if(ape->totalframes > UINT_MAX / sizeof(APEFrame)){
av_log(s, AV_LOG_ERROR, "Too many frames: %d\n", ape->totalframes);
return -1;
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