<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div><br></div><div>On Fri, Mar 13, 2020, at 15:47, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt"><div>1) You could and probably should use stream_GetSize().<br></div></blockquote><div><br></div><div>OK, will do in a separate commit.<br></div><div><br></div><blockquote type="cite" id="qt"><div>2) The error case will be caught by the overflow comparison. I'm asking about 0, not about strictly negative values.<br></div><div><br></div><div class="qt-gmail_quote"><div>Le 13 mars 2020 16:13:45 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre class="qt-k9mail"><div><br></div><div><br></div><div>On Thu, Mar 12, 2020, at 17:36, Remi Denis-Courmont wrote:<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div>Le 2020-03-12 16:05, Thomas Guillem a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(173, 127, 168);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div>Use the same type than vlc_stream_Tell().<hr> modules/demux/wav.c | 5 +++--<br></div><div> 1 file changed, 3 insertions(+), 2 deletions(-)<br></div><div><br></div><div>diff --git a/modules/demux/wav.c b/modules/demux/wav.c<br></div><div>index c8829648730..5997a3c1865 100644<br></div><div>--- a/modules/demux/wav.c<br></div><div>+++ b/modules/demux/wav.c<br></div><div>@@ -46,7 +46,7 @@ typedef struct<br></div><div> es_format_t fmt;<br></div><div> es_out_id_t *p_es;<br></div><div><br></div><div>- int64_t i_data_pos;<br></div><div>+ uint64_t i_data_pos;<br></div><div> int64_t i_data_size;<br></div><div><br></div><div> unsigned int i_frame_size;<br></div><div>@@ -594,7 +594,8 @@ static int Open( vlc_object_t * p_this )<br></div><div> if( !b_is_rf64 || i_size < UINT32_MAX )<br></div><div> {<br></div><div> int64_t i_stream_size = stream_Size( p_demux->s );<br></div><div>- if( i_stream_size > 0 && i_stream_size >= i_size + <br></div><div>p_sys->i_data_pos )<br></div><div>+ if( i_stream_size > 0<br></div><div>+ && (uint64_t) i_stream_size >= i_size + p_sys->i_data_pos )<br></div><div> p_sys->i_data_size = i_size;<br></div><div> }<br></div></blockquote><div><br></div><div>Do you really still need to special case 0 ?<br></div></blockquote><div><br></div><div>I think it's still needed because you don't want to case to uint64_t if the value is negative (in case of stream_Size() error).<br></div><div><br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div> <br></div><div> -- <br></div><div> Rémi Denis-Courmont<br></div></blockquote><div><br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></body></html>