[FFmpeg-devel] [PATCH 1/5] avformat/dashenc: fix invalid pointer access if avio_get_dyn_buf failed

lance.lmwang at gmail.com lance.lmwang at gmail.com
Thu Apr 30 04:17:05 EEST 2020


On Wed, Apr 29, 2020 at 06:55:33PM +0200, Nicolas George wrote:
> lance.lmwang at gmail.com (12020-04-29):
> > Thanks, I catch your point now. Most of existing code haven't return ERROR, so I
> > choose the same way to process it. If you think it's not OK, we'll change more
> > code I think.
> 
> Maybe the other code needs to be fixed the same way. Maybe the other
> code needs not return an error and this one does. Maybe your change is
> actually valid.
> 
> You cannot know unless you first understand what the code does and what
> it is supposed to do. You cannot program by imitation, it does not work.
> 
> And you have to test your changes: run a ffmpeg command line, make sure
> the new code is triggered, and check the output file, compare it with
> when the change is not triggered. If they are both correct, good. If one
> is corrupted, then you know your change was bogus. And if you did not
> test, then your change cannot be accepted.

Sorry, the old code will segment fault but the new code will not if error
happened. so I have no idea what's to compare the output as it's error.
Also all of the code which are using avio_get_dyn_buf() didn't check the size
for error. I had to say the avio_get_dyn_buf() is designed very well.

Can we change avio_get_dyn_buf() to return the error directly? also the 
description of API isn't clear for the error condition.


> 
> Ideally we can trust regular contributors to have tested their changes
> and run FATE before submitting patches.
> 
> Regards,
> 
> -- 
>   Nicolas George



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list