[FFmpeg-devel] [RFC] cryptokey options

Michael Niedermayer michaelni
Fri Dec 14 00:49:34 CET 2007


Hi

On Thu, Dec 13, 2007 at 12:14:20PM +0100, Reimar D?ffinger wrote:
> Hello,
> On Mon, Dec 03, 2007 at 01:03:24AM +0100, Michael Niedermayer wrote:
> [...]
> > > Index: libavcodec/opt.c
> > > ===================================================================
> > > --- libavcodec/opt.c	(revision 11089)
> > > +++ libavcodec/opt.c	(working copy)
> > > @@ -69,6 +69,7 @@
> > >      case FF_OPT_TYPE_RATIONAL:
> > >          if((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};
> > >          else                *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);
> > > +        break;
> > >      default:
> > >          return NULL;
> > >      }
> > 
> > unrelated?
> 
> Removed.
> 
> > [...]
> > > @@ -114,6 +122,25 @@
> > >      }
> > >      if(!o || !val || o->offset<=0)
> > >          return NULL;
> > > +    if(o->type == FF_OPT_TYPE_BINARY){
> > > +        uint8_t *bin, *ptr;
> > > +        int len = strlen(val);
> > > +        if (len & 1) return NULL;
> > > +        len /= 2;
> > > +        ptr = bin = av_malloc(len);
> > 
> > where is this freed() ? it seems nowhere ...
> > a series of av_set_string() would leak ...
> 
> Hopefully fixed and generally less ugly.
> 
> > [...]
> > > @@ -67,6 +68,7 @@
> > >  #define AV_OPT_FLAG_SUBTITLE_PARAM  32
> > >  //FIXME think about enc-audio, ... style flags
> > >      const char *unit;
> > > +    int offset2;
> > >  } AVOption;
> > 
> > actually, this is unneeded
> > offset + sizeof(void*) should do
> 
> Changed, though I do not like such implicit "assumptions" too much.

patch is probably ok
am not really happy about the av_malloc() dependancy but i guess its
hard to avoid

[...]


-- 
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/20071214/a8a3a2b6/attachment.pgp>



More information about the ffmpeg-devel mailing list