[FFmpeg-devel] [PATCH] check for invalid sym values in indeo decoder (issue 2523)

Michael Niedermayer michaelni
Sat Jan 15 02:42:13 CET 2011


On Tue, Jan 11, 2011 at 05:00:55PM -0500, Daniel Kang wrote:
> On Tue, Jan 11, 2011 at 4:21 PM, Kostya <kostya.shishkov at gmail.com> wrote:
> 
> > On Tue, Jan 11, 2011 at 03:26:19PM -0500, Daniel Kang wrote:
> > > On Tue, Jan 11, 2011 at 11:24 AM, Michael Niedermayer <michaelni at gmx.at
> > >wrote:
> > >
> > [...]
> > > >
> > > > this is a error condition and continuing with undefined values makes no
> > > > sense
> > > > also i suspect only one of teh 2 checks is needed
> > >
> > >
> > > I have updated the message and return an error. The invalid sym in this
> > > case are -1. I am not sure if the other check is needed, as the sample
> > > file does not encounter values greater than 256.
> >
> > else{} is not needed there, just move assignment under the check
> 
> 
> Patch updated without the else.

>  ivi_common.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 74f624d397ede46b559b689765719acfd7bba1e5  indeo_invalid_sym_check.diff
> From 9d36b5fc04f984f30dce1c4fd4f3f513f4d59c32 Mon Sep 17 00:00:00 2001
> From: Daniel Kang <daniel.d.kang at gmail.com>
> Date: Sun, 9 Jan 2011 18:50:28 -0500
> Subject: [PATCH] Check for invalid indeo sym value
> 
> ---
>  libavcodec/ivi_common.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
> index b158458..0788959 100644
> --- a/libavcodec/ivi_common.c
> +++ b/libavcodec/ivi_common.c
> @@ -404,6 +404,10 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
>                          hi  = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
>                          val = IVI_TOSIGNED((hi << 6) | lo); /* merge them and convert into signed val */
>                      } else {
> +                        if (sym < 0 || sym >= 256) {

this can be simplifed to
if(sym >= 256U)

because 256U is unsigned and that makes the comparission unsigned and negative
values are when looked at unsigned large

otherwise ok from my side as well

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110115/2747a0fe/attachment.pgp>



More information about the ffmpeg-devel mailing list