if (bs + size - 2 >= bs_end)
return AVPROBE_SCORE_MAX / 4 - 1; //seems to be valid MPC but no header yet
if (header_found) {
-
- if (size < 11 || size > 28)
- return 0;
- if (!AV_RL32(bs)) //zero CRC is invalid
- return 0;
- return AVPROBE_SCORE_MAX;
+ if (size < 11 || size > 28)
+ return 0;
+ if (!AV_RL32(bs)) //zero CRC is invalid
+ return 0;
+ return AVPROBE_SCORE_MAX;
} else {
bs += size - 2;
}
st = av_new_stream(s, 0);
if (!st)
return AVERROR(ENOMEM);
- st->codec->codec_type = CODEC_TYPE_AUDIO;
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_MUSEPACK8;
st->codec->bits_per_coded_sample = 16;
while(!url_feof(s->pb)){
pos = url_ftell(s->pb);
mpc8_get_chunk_header(s->pb, &tag, &size);
+ if (size < 0)
+ return -1;
if(tag == TAG_AUDIOPACKET){
if(av_get_packet(s->pb, pkt, size) < 0)
return AVERROR(ENOMEM);