<html><head></head><body>1) You could and probably should use stream_GetSize().<br>2) The error case will be caught by the overflow comparison. I'm asking about 0, not about strictly negative values.<br><br><div class="gmail_quote">Le 13 mars 2020 16:13:45 GMT+02:00, Thomas Guillem <thomas@gllm.fr> 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"><br><br>On Thu, Mar 12, 2020, at 17:36, Remi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le 2020-03-12 16:05, Thomas Guillem a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">Use the same type than vlc_stream_Tell().<hr> modules/demux/wav.c | 5 +++--<br> 1 file changed, 3 insertions(+), 2 deletions(-)<br><br>diff --git a/modules/demux/wav.c b/modules/demux/wav.c<br>index c8829648730..5997a3c1865 100644<br>--- a/modules/demux/wav.c<br>+++ b/modules/demux/wav.c<br>@@ -46,7 +46,7 @@ typedef struct<br> es_format_t fmt;<br> es_out_id_t *p_es;<br><br>- int64_t i_data_pos;<br>+ uint64_t i_data_pos;<br> int64_t i_data_size;<br><br> unsigned int i_frame_size;<br>@@ -594,7 +594,8 @@ static int Open( vlc_object_t * p_this )<br> if( !b_is_rf64 || i_size < UINT32_MAX )<br> {<br> int64_t i_stream_size = stream_Size( p_demux->s );<br>- if( i_stream_size > 0 && i_stream_size >= i_size + <br>p_sys->i_data_pos )<br>+ if( i_stream_size > 0<br>+ && (uint64_t) i_stream_size >= i_size + p_sys->i_data_pos )<br> p_sys->i_data_size = i_size;<br> }<br></blockquote><br>Do you really still need to special case 0 ?<br></blockquote><br>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><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <br> -- <br> Rémi Denis-Courmont<br><br></blockquote><br></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>