[FFmpeg-devel] [PATCH]Read aspect ratio from tiff files
Michael Niedermayer
michaelni at gmx.at
Mon Apr 7 05:11:10 CEST 2014
On Mon, Apr 07, 2014 at 02:59:16AM +0200, Carl Eugen Hoyos wrote:
> On Monday 07 April 2014 01:32:50 am Michael Niedermayer wrote:
> > > +static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned
> > > den) +{
> > > + int offset = tag == TIFF_YRES ? 2 : 0;
> > > + s->res[offset++] = num;
> > > + s->res[offset] = den;
> > > + if (s->res[0] && s->res[1] && s->res[2] && s->res[3])
> > > + av_reduce(&s->avctx->sample_aspect_ratio.num,
> > > &s->avctx->sample_aspect_ratio.den, + s->res[2] *
> > > s->res[1], s->res[0] * s->res[3], INT32_MAX);
> >
> > these need to be cast tp 64bit to avid overflows unless
> > something ensures they are not more than 16bit
>
> New patch attached.
>
> Thank you, Carl Eugen
breaks fate-exif-image-tiff
otherwise it should be ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140407/fab19e36/attachment.asc>
More information about the ffmpeg-devel
mailing list