[FFmpeg-devel] [PATCH] diracdec: check that block length is large enough

Michael Niedermayer michaelni at gmx.at
Wed May 6 18:11:58 CEST 2015


On Wed, May 06, 2015 at 03:39:02PM +0200, Andreas Cadhalpun wrote:
> On 06.05.2015 01:49, Michael Niedermayer wrote:
> > On Tue, May 05, 2015 at 10:39:50PM +0200, Andreas Cadhalpun wrote:
> >> +    if (s->plane[0].xblen >> s->chroma_x_shift <= 0 || s->plane[0].yblen >> s->chroma_y_shift <= 0) {
> >> +        av_log(s->avctx, AV_LOG_ERROR, "Block length too small\n");
> >> +        return -1;
> >> +    }
> > 
> > a broader check is possible
> > the spec says "Frame height shall be an integer multiple of picture chroma height."
> > in 10.5.1
> > ive not found an equivalent for width but from rounding the chroma
> > width down i doubt that the spec intends to allow non multiplies for
> > the width
> 
> OK, new patch attached.
> 
> Best regards,
> Andreas
> 

>  diracdec.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 23dcbeeaf39dd41ec6b4343395f4d9e00274f7df  0001-diracdec-check-that-block-length-is-valid.patch
> From 2269fc041c160a7e5acff6984186240f05d90bf0 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Wed, 6 May 2015 15:34:53 +0200
> Subject: [PATCH] diracdec: check that block length is valid
> 
> In init_planes p->xblen and p->yblen are set to:
>             p->xblen = s->plane[0].xblen >> s->chroma_x_shift;
>             p->yblen = s->plane[0].yblen >> s->chroma_y_shift;
> 
> These are later used as block_w and block_h arguments of
> s->vdsp.emulated_edge_mc. If one of them is 0 it triggers an av_assert2
> in emulated_edge_mc:
>     av_assert2(start_x < end_x && block_w > 0);
>     av_assert2(start_y < end_y && block_h > 0);
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150506/c919f52c/attachment.asc>


More information about the ffmpeg-devel mailing list