[FFmpeg-devel] [PATCH] avcodec: validate codec parameters in avcodec_parameters_to_context

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Wed Oct 26 02:44:39 EEST 2016


On 25.10.2016 13:43, Michael Niedermayer wrote:
> On Tue, Oct 25, 2016 at 01:50:47AM +0200, Andreas Cadhalpun wrote:
>> This should reduce the impact of a demuxer (or API user) setting bogus
>> codec parameters.
>>
>> Suggested-by: wm4
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavcodec/utils.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 81 insertions(+), 1 deletion(-)
> 
> This adds some warnings:
> 
> libavcodec/utils.c: In function ‘avcodec_parameters_to_context’:
> libavcodec/utils.c:4256:9: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> libavcodec/utils.c:4261:9: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> libavcodec/utils.c:4266:9: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> libavcodec/utils.c:4271:9: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> libavcodec/utils.c:4276:9: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> 
> i guess thats enum (un)signednes ...

I'll just cast the enums to unsigned and check for > *_NB.

Best regards,
Andreas


More information about the ffmpeg-devel mailing list