[FFmpeg-devel] [PATCH]lavf/pcmdec: Map mime_type audio/L16 to the s16le demuxer
Carl Eugen Hoyos
ceffmpeg at gmail.com
Wed Aug 17 19:14:18 EEST 2016
Hi!
2016-08-17 17:32 GMT+02:00 Michael Niedermayer <michael at niedermayer.cc>:
>> + av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);
>> + if (mime_type && s->iformat->mime_type) {
>> + int rate = 0, channels = 0;
>> + size_t len = strlen(s->iformat->mime_type);
>> + if (!strncmp(s->iformat->mime_type, mime_type, len)) {
>> + uint8_t *options = mime_type + len;
>> + len = strlen(mime_type);
>> + while (options < mime_type + len) {
>> + options = strstr(options, ";");
>> + if (!options++)
>> + break;
>> + if (!rate)
>> + sscanf(options, " rate=%d", &rate);
>> + if (!channels)
>> + sscanf(options, " channels=%d", &channels);
>> + }
>
> rate and channels probably should be subject to some sanity checks
> like < 0
Sanity checks for <0 added, INT_MAX is also possible with the current
code.
Patch applied, Carl Eugen
More information about the ffmpeg-devel
mailing list