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

Nicolas George george at nsup.org
Wed Apr 29 18:18:18 EEST 2020


lance.lmwang at gmail.com (12020-04-29):
> From: Limin Wang <lance.lmwang at gmail.com>
> 
> If an error occurs, avio_get_dyn_buf() will return 0 and buf is NULL, so it's necessary to check
> the return value for the following code will access the buf pointer with index. In addition,
> the buf len should be greater than written_len to avoid the buffer overflow access.
> 
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavformat/dashenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

And if the allocation fails, the data is silently discarded. Seems
broken. Did you test your change?

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/20200429/1be82c3d/attachment.sig>


More information about the ffmpeg-devel mailing list