<html><head></head><body>Hi,<br><br>Not claiming that it's wrong, but how could it not crash if FFmpeg freed a pointer to .rodata?<br><br><div class="gmail_quote">Le 15 juillet 2019 10:22:35 GMT+03:00, Steve Lhomme <git@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">vlc | branch: master | Steve Lhomme <robux4@ycbcr.xyz> | Wed Jul 10 08:23:45 2019 +0200| [d86c4c87aa78130a4fd00294e25df865d0e2b327] | committer: Steve Lhomme<br><br>avcodec: encoder: fix MPEG4 matrix passed as const<br><br>lavc expects a pointer that it will free in avcodec_free_context().<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d86c4c87aa78130a4fd00294e25df865d0e2b327">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d86c4c87aa78130a4fd00294e25df865d0e2b327</a><br></blockquote><hr> modules/codec/avcodec/encoder.c | 10 ++++++++--<br> 1 file changed, 8 insertions(+), 2 deletions(-)<br><br>diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c<br>index cbac0d3394..2564e0a518 100644<br>--- a/modules/codec/avcodec/encoder.c<br>+++ b/modules/codec/avcodec/encoder.c<br>@@ -580,8 +580,14 @@ int InitVideoEnc( vlc_object_t *p_this )<br> <br> if ( p_sys->b_mpeg4_matrix )<br> {<br>- p_context->intra_matrix = mpeg4_default_intra_matrix;<br>- p_context->inter_matrix = mpeg4_default_non_intra_matrix;<br>+ p_context->intra_matrix = av_malloc( sizeof(mpeg4_default_intra_matrix) );<br>+ if ( p_context->intra_matrix )<br>+ memcpy( p_context->intra_matrix, mpeg4_default_intra_matrix,<br>+ sizeof(mpeg4_default_intra_matrix));<br>+ p_context->inter_matrix = av_malloc( sizeof(mpeg4_default_non_intra_matrix) );<br>+ if ( p_context->inter_matrix )<br>+ memcpy( p_context->inter_matrix, mpeg4_default_non_intra_matrix,<br>+ sizeof(mpeg4_default_non_intra_matrix));<br> }<br> <br> if ( p_sys->b_pre_me )<hr>vlc-commits mailing list<br>vlc-commits@videolan.org<br><a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>