[FFmpeg-devel] [PATCH 1/2] libopenjpegdec: set max_lowres to UINT8_MAX

Michael Niedermayer michaelni at gmx.at
Fri Aug 3 16:13:58 CEST 2012


On Fri, Aug 03, 2012 at 08:11:01AM -0600, Michael Bradshaw wrote:
> On Thu, Jul 19, 2012 at 1:20 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Wed, Jul 18, 2012 at 09:51:44PM -0600, Michael Bradshaw wrote:
> >> Paul pointed out that OpenJPEG doesn't have a max lowres limit. See
> >> http://ffmpeg.org/pipermail/ffmpeg-devel/2012-July/127906.html
> >>
> >> This removes the arbitrary limit.
> >>
> >> Thanks,
> >>
> >> Michael
> >
> >>  libopenjpegdec.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> bc2d62e1146b20a9da2d5cd1e86884081e7c0cd8  0001-libopenjpegdec-set-max_lowres-to-UINT8_MAX.patch
> >> From 643d6db4faf35b57b8d834d4dd1db90165ad257f Mon Sep 17 00:00:00 2001
> >> From: Michael Bradshaw <mbradshaw at sorensonmedia.com>
> >> Date: Wed, 18 Jul 2012 21:47:33 -0600
> >> Subject: [PATCH 1/2] libopenjpegdec: set max_lowres to UINT8_MAX
> >>
> >> OpenJPEG doesn't have a max limit, so don't enforce an arbitrary one.
> >>
> >> Signed-off-by: Michael Bradshaw <mbradshaw at sorensonmedia.com>
> >> ---
> >>  libavcodec/libopenjpegdec.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
> >> index 5b5d27b..31fff7c 100644
> >> --- a/libavcodec/libopenjpegdec.c
> >> +++ b/libavcodec/libopenjpegdec.c
> >> @@ -388,7 +388,7 @@ AVCodec ff_libopenjpeg_decoder = {
> >>      .close            = libopenjpeg_decode_close,
> >>      .decode           = libopenjpeg_decode_frame,
> >>      .capabilities     = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
> >> -    .max_lowres       = 5,
> >> +    .max_lowres       = UINT8_MAX,
> >
> > this is possibly problematic
> >
> > lowres is in log2 units, a value of 255 would dwarf the act of
> > reducing a image the size of teh vissible universe with pixels as
> > small as subatomic particles down to a single pixel.
> > that alone wouldnt be a problem but a more realworld issue
> > is that lowres is used in the form of width >> lowres and shifts
> > become undefined when they exceed the number of bits of the shifted
> > field, thus i would suggest that the largest limit would be 31 or
> > possibly less. 31 still would allow 2147483648x2147483648 to be
> > decoded as 1x1.
> 
> Hi,
> 
> I've changed to patch to use 31. The new version is attached.
> 
> Thanks,
> 
> Michael

>  libopenjpegdec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 05adafd401b66754e4f72e06c34a5f99ef48e6fe  0001-libopenjpegdec-increase-max-lowres-from-5-to-31.patch
> From 2efd759d8f8ea279e53001c042ed7f272247e366 Mon Sep 17 00:00:00 2001
> From: Michael Bradshaw <mbradshaw at sorensonmedia.com>
> Date: Fri, 3 Aug 2012 08:07:48 -0600
> Subject: [PATCH] libopenjpegdec: increase max lowres from 5 to 31
> 
> OpenJPEG doesn't have a particular limit

applied thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/20120803/d551e724/attachment.asc>


More information about the ffmpeg-devel mailing list