forked from len0rd/rockbox
Don't assume files are WMAv2, instead actually check that they are and quit gracefully if they are not.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13855 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
de4904a189
commit
28b0c58726
2 changed files with 12 additions and 5 deletions
|
@ -550,8 +550,11 @@ int wma_decode_init(WMADecodeContext* s, asf_waveformatex_t *wfx)
|
||||||
|
|
||||||
if (wfx->codec_id == ASF_CODEC_ID_WMAV1){
|
if (wfx->codec_id == ASF_CODEC_ID_WMAV1){
|
||||||
s->version = 1;
|
s->version = 1;
|
||||||
}else{
|
}else if (wfx->codec_id == ASF_CODEC_ID_WMAV2 ){
|
||||||
s->version = 2;
|
s->version = 2;
|
||||||
|
}else{
|
||||||
|
/*one of those other wma flavors that don't have GPLed decoders */
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* extract flag infos */
|
/* extract flag infos */
|
||||||
|
|
|
@ -342,7 +342,11 @@ enum codec_status codec_main(void)
|
||||||
saves us from parsing it again here. */
|
saves us from parsing it again here. */
|
||||||
memcpy(&wfx, ci->id3->toc, sizeof(wfx));
|
memcpy(&wfx, ci->id3->toc, sizeof(wfx));
|
||||||
|
|
||||||
wma_decode_init(&wmadec,&wfx);
|
if(wma_decode_init(&wmadec,&wfx)< 0){
|
||||||
|
LOGF("WMA: Unsupported or corrupt file\n");
|
||||||
|
retval = CODEC_ERROR;
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now advance the file position to the first frame */
|
/* Now advance the file position to the first frame */
|
||||||
ci->seek_buffer(ci->id3->first_frame_offset);
|
ci->seek_buffer(ci->id3->first_frame_offset);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue