[FFmpeg-devel] [PATCH] add forgotten check for frame_start() return value
Wed Feb 18 16:42:34 CET 2009
On Wed, Feb 18, 2009 at 04:26:00PM +0100, Michael Niedermayer wrote:
> On Wed, Feb 18, 2009 at 04:19:51PM +0100, Reimar D?ffinger wrote:
> > On Wed, Feb 18, 2009 at 04:00:02PM +0100, Michael Niedermayer wrote:
> > > On Wed, Feb 18, 2009 at 11:25:27AM +0100, Reimar D?ffinger wrote:
> > > > if get_buffer fails, the H.264 decoder may crash.
> > > > This patch fixes this by adding an obviously forgotten return value
> > > > check for frame_start:
> > >
> > > why is the other frame_start setting first_field= 0 and yours not?
> > Because setting first_field is not necessary to stop it crashing (thus
> > even if it should be done it could be considered better to apply
> > separately) and I do not want to make changes I neither understand
> > nor know how to test.
> if you consider this awnser enough then apply
Not really, but it is all I know.
Or more precisely I know:
1) it prevents a crash, so it is better than the current code
2) the second frame_start is under a !FIELD_PICTURE || s0->first_field
condition, so it is somehow related to s0->first_field while this one is
I can not say if the code is correct after this change, though I can say
it is better.
I can also add a "TODO: check if s0->first_field = 0 is necessary", but
I also do not know if e.g. maybe instead of return -1 it should just do
continue (after updating prev_frame_num).
More information about the ffmpeg-devel