[FFmpeg-devel] [PATCH]lavf/pcmdec: Map mime_type audio/L16 to the s16le demuxer

James Almer jamrial at gmail.com
Thu Aug 18 07:47:44 EEST 2016


On 8/17/2016 1:14 PM, Carl Eugen Hoyos wrote:
> 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

This broke msvc
http://fate.ffmpeg.org/log.cgi?time=20160817230315&log=compile&slot=x86_64-msvc12-windows-native

Moving __VA_ARGS__ to the end of the macro may be enough to fix this,
but i can't test.


More information about the ffmpeg-devel mailing list