Menu

#81 a2play segfaults on bad sample rates

open
nobody
None
5
2007-01-10
2007-01-10
Adam Bliss
No

If you try to play a sound file with a2play that isn't in one of the 4 sampling frequencies supported by sbc, the a2play executable segfaults. Better would be to inform the user where to look for the error:

@@ -895,12 +892,6 @@
size2 += len;
}
len = sbc_encode(&sbc, buf2, size2);//do the encoding
-
- if (sbc.len < 0) {
- fprintf(stderr, "Error code: %d\n", sbc.len);
- perror("sbc_pack_frame failed. See sbc.c for error code.");
- exit(-1);
- }
sleeptime = sbc.duration;
sbc_info.blocks = sbc.blocks;
sbc_info.subbands = sbc.subbands;

Discussion


Log in to post a comment.