Re: [FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

2018-12-17 Thread Michael Niedermayer
On Sun, Dec 16, 2018 at 09:42:49PM +0100, Tomas Härdin wrote: > fre 2018-12-14 klockan 13:44 -0800 skrev chcunningham: > > avio_read may return EOF, leaving the mimetype array unitialized. > > fail > > early when this occurs to avoid using the array in an unitialized > > state. > > --- > >  

Re: [FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

2018-12-16 Thread Tomas Härdin
fre 2018-12-14 klockan 13:44 -0800 skrev chcunningham: > avio_read may return EOF, leaving the mimetype array unitialized. > fail > early when this occurs to avoid using the array in an unitialized > state. > --- >  libavformat/id3v2.c | 6 -- >  1 file changed, 4 insertions(+), 2 deletions(-)

Re: [FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

2018-12-14 Thread Chris Cunningham
> > -char mimetype[64]; > +char mimetype[64] = {0}; > > would be enough > Agree! Next patch. I'd love to do similar for the isv34 branch, but I'm not sure how to detect > the condition given the EOF behavior for avio_get_str: > * @return number of bytes read (is always <= maxlen). > * If

Re: [FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

2018-12-14 Thread Tomas Härdin
tor 2018-12-13 klockan 11:28 -0800 skrev chcunningham: > avio_read may return EOF, leaving the mimetype array unitialized. fail > early when this occurs to avoid using the array in an unitialized state. > --- >  libavformat/id3v2.c | 5 - >  1 file changed, 4 insertions(+), 1 deletion(-) > >

Re: [FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

2018-12-13 Thread Chris Cunningham
> > Yet another problem that could have been caught by static analysis.. > Wouldn't it be better to always leave the array in a valid state? > Will add that in the next patch. It has the extra benefit of protecting the isv34 branch. Goto fail; skips a lot of lines that aren't needed if mimetype

Re: [FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

2018-12-13 Thread Tomas Härdin
ons 2018-12-12 klockan 18:59 -0800 skrev chcunningham: > avio_read may return EOF, leaving the mimetype array unitialized. fail > early when this occurs to avoid using the array in an unitialized state. > --- >  libavformat/id3v2.c | 4 +++- >  1 file changed, 3 insertions(+), 1 deletion(-) > >