[Ffmpeg-devel] [PATCH] fix segment fault in h264_parse if buf_size is zero

Limin Wang lance.lmwang
Wed Apr 11 03:33:20 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

> > Index: libavcodec/h264.c
> > ===================================================================
> > --- libavcodec/h264.c	(revision 8688)
> > +++ libavcodec/h264.c	(working copy)
> > @@ -8059,7 +8059,7 @@
> >              return buf_size;
> >          }
> >  
> > -        if(next<0){
> > +        if(next<0 && pc->last_index+next > 0){
> 
> i think the check should rather be next<0 && next != END_NOT_FOUND

It's OK for the file end case, however anybody can make sure in these
condition, pc->last_index + next>=0? The logic isn't clear and difficult
to maintain.

Only h264 parser will find_frame_end again if next<0, by the comment, the
author want to update state, who can explain further? Any fault if remove the
next 3 line code?


Thanks,
Limin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBRhw630ztbf7dKiuoAQIh0gf/ZkhMPpwEYkHoFIbuxsAVY/suNWcrpNeN
DGhLCE3zwXTE+/anQtcosWc20QW89gCAEGJPkRZKRadlJzjwsWAFErykhtsCank5
TDTmWZejRkF5ok8KBYEboHHUkrtDe4+ZFIGLRCxQ083nqt4Ml1uamZgJMlilPkle
psNobwNHPLMXUmdokQzhhYyLKsH/QknRgpFwP47bbjDKTKSCJuDkRuIOs+X/hgsp
d3/exCn9gmFyqxIdCutEXIXt3+zY3wgvLAEJKNVLAs7RKFyzCAN6yF0yOkW1a92F
VjaHdPtzIQY7z7OBGkvDde1cTPVTLtfjfOR9ko7E0wfJepAUIDkkPg==
=gfiN
-----END PGP SIGNATURE-----




More information about the ffmpeg-devel mailing list