[FFmpeg-devel] [PATCH] mov: Skip computing SAR from invalid display matrix elements

Vittorio Giovara vittorio.giovara at gmail.com
Tue Mar 30 19:55:27 EEST 2021


Hello,
I was debugging an issue with a video file containing an invalid
display matrix, probably produced by a non conforming software.

The content of the matrix is:
00000000:            0       65536           0
00000001:           -1           0           0
00000002:            0           0  1073741824

The -1 (stored as 4294967295) was probably a 1 shifted 32 times instead
of 16. The problem is that this value is bypassing the validation check
in the code below, and the resulting computed SAR value becomes 1:65536.

This change interprets extremely low entries as invalid and makes sure
to skip them in the SAR computation. This passes fate, but I haven't been
able to test this extensively.
Please see the attached patch, any feedback or better solution is welcome.
-- 
Vittorio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mov-Skip-computing-SAR-from-invalid-display-matrix-e.patch
Type: application/octet-stream
Size: 1026 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210330/6cc6ad91/attachment.obj>


More information about the ffmpeg-devel mailing list