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

Jan Ekstrom jeebjp at gmail.com
Mon Sep 26 09:42:32 EEST 2016


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.

Jan


More information about the ffmpeg-devel mailing list