[FFmpeg-devel] [PATCH 1/2] lavf/mxfdec: add support for all of the picture size and offset fields

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Sep 26 10:00:51 EEST 2016

2016-09-26 8:42 GMT+02:00 Jan Ekstrom <jeebjp at gmail.com>:
> On Sep 26, 2016 09:29, "Carl Eugen Hoyos" <ceffmpeg at gmail.com> wrote:
>> 2016-09-26 1:52 GMT+02:00 Jan Ekström <jeebjp at gmail.com>:
>> If this fixes anything (I am not sure I understand: Are you changing a
>> type which introduces a possible undefined behaviour, so you add an
>> additional check at the same time?) it should be part of above new
>> patch imo (or an independent patch).
> The specification notes that width and height are uint32 in MXF. Thus the
> old type of "int" was incorrect. The width and height of codecpar are "int"
> so by fixing the type it can overflow (you'd get negative values), and thus
> have to be capped.
> The old code would have had thus an overflow happen naturally in the
> case of a large enough unsigned integer as the value would have been
> read into an int.

I thought no overflow happens in that case but it does not really matter:
FFmpeg ignores even 16bit width / height (for msb set).

Carl Eugen

More information about the ffmpeg-devel mailing list