[FFmpeg-devel] [PATCH] Ensure sample_aspect_ratio.den is nonzero

David Conrad lessen42
Wed Apr 21 12:32:58 CEST 2010


Currently no decoders check for validity of sample_aspect_ratio, specifically, whether sample_aspect_ratio.den is nonzero. This leads to an issue with theora files, which have 0/0 written a lot of the time, causing ffmpeg to calculate an aspect ratio of 4/1 after some math involving NaNs.

Since "unknown" is the only valid interpretation of a denominator of zero, this adds a check to both avcodec_open() and avcodec_decode_video2() to set {0,1} which is a safer value to give to user applications.

Alternatively, I could put the check in each codec that sets it directly from the bitstream, or clarify the API that a zero denominator is allowed and fix ffmpeg.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textmate stdin pXmtrr.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100421/6406cc4f/attachment.txt>

More information about the ffmpeg-devel mailing list