Quoting Vittorio Giovara (2021-03-31 18:43:02) > On Wed, Mar 31, 2021 at 2:41 PM Anton Khirnov <an...@khirnov.net> wrote: > > > Quoting Vittorio Giovara (2021-03-30 18:55:27) > > > 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 > > > > > > From 54ec72276cbb6f2536e73ff81b7d49a736ec1900 Mon Sep 17 00:00:00 2001 > > > From: Vittorio Giovara <vittorio.giov...@gmail.com> > > > Date: Tue, 30 Mar 2021 16:47:39 +0200 > > > Subject: [PATCH] mov: Skip computing SAR from invalid display matrix > > elements > > > > > > --- > > > > I'm wondering if that code should set sample_aspect_ratio at all. There > > are two other bits of code in mov.c that may set sample_aspect_ratio, > > and it's not clear whether it applies _in addition_ to the display > > matrix or not. > > > > Unfortunately there are many (old-ish) samples that rely on the display > matrix to adjust the aspect ratio. > We added a test for this case in particular, check out fate-mov-zombie if > you have some time.
But then what do you do if a file has both the display matrix and the pasp atom? -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".