[FFmpeg-devel] [PATCH] Electronic Arts TGV decoder

Michael Niedermayer michaelni
Sat Jul 19 13:48:30 CEST 2008


On Sat, Jul 19, 2008 at 02:43:23PM +1000, pross at xvid.org wrote:
> On Sat, Jul 19, 2008 at 04:40:10AM +0200, Michael Niedermayer wrote:
> > On Sat, Jul 19, 2008 at 11:41:05AM +1000, pross at xvid.org wrote:
> > > On Thu, Jul 17, 2008 at 11:52:35PM +0200, Michael Niedermayer wrote:
> > > > On Wed, Jul 16, 2008 at 06:51:15PM +1000, pross at xvid.org wrote:
> > > > > On Mon, Jul 14, 2008 at 01:27:55PM +0200, Michael Niedermayer wrote:
> > > > > > On Mon, Jul 14, 2008 at 09:21:38PM +1000, pross at xvid.org wrote:
> > > > > > > On Sun, Jul 13, 2008 at 12:12:32AM +0200, Michael Niedermayer wrote:
> > > > > > > > On Sat, Jul 12, 2008 at 04:32:20PM +1000, pross at xvid.org wrote:
> > > > > > > > > On Thu, Jul 10, 2008 at 01:00:32AM +0200, Michael Niedermayer wrote:
> > > > > > > > > > On Wed, Jul 09, 2008 at 09:18:13PM +1000, pross at xvid.org wrote:
> > > > > > > > > > > Hi!
> > > > > > > > > > > 
> > > > > > > > > > > Second video codec in the EA series.
> > > > > > > > > > > 
> > > > > > > > > > > Samples: http://samples.mplayerhq.hu/game-formats/ea-tgv/
> > > > > > > > > > > Write-up: http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TGV
> > > > > > > > > > [...]
> > > > > > > > > 
> > > > > > > > > Revised patch enclosed.
> > > > > > > > [...]
> > > > > > > Certainly worth testing. How do I "cleanly" allocate an AVFrame with
> > > > > > > linesize tied to width? (grepping lavc for -v DR1 examples was not 
> > > > > > > productive...)
> > > > > > my_frame.data[0]= av_malloc(width*height)
> > > > > > linesize[0]= width
> > > > > 
> 
> > > Index: libavutil/lzo.*
> > 
> > looks ok i think, though reimar is maintainer of that
> > reimar?
> 
> Okay. 
> 
> > the still isnt safe, dst_start+offset can overflow as well, just think of
> > the array being at the end of the virtual memory space.
> > dst_start= 0xFFFFFFFF-array_size
> > This may be unrealistic i wont dispute that but still ..
> > is there a problem with the solution i suggested?
> 
> No problem. My mistake. Fixed.
[...]

> +
> +        /* fetch strip from src */
> +        if (src+size1>src_end)
> +            break;

this one too should be written as size1 > src_end - src, though its less
critical

[...]

> +    if (s->mv_codebook) av_free(s->mv_codebook);
> +    if (s->block_codebook) av_free(s->block_codebook);

The checks are redundant


after these 2 the decoder looks ok


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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080719/50ecafea/attachment.pgp>



More information about the ffmpeg-devel mailing list