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

Nicolas George george at nsup.org
Thu Apr 30 13:34:02 EEST 2020


lance.lmwang at gmail.com (12020-04-30):
> 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.

A segfault is better than corrupted data and better than lost data. So
your task is to examine the output file and check whether it is
corrupted and whether it contains all the data it should contain.

> 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.

It seems avio_get_dyn_buf() is not a very good API, indeed. I do not
know if it can be fixed. It is public, and therefore hard to change.

I have been working on a better API for this kind of thing. Can I count
on your support when I propose it again?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200430/e9e95ee4/attachment.sig>


More information about the ffmpeg-devel mailing list