<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi liyoubdu,</p>
<p>On 2017-02-07 10:43, liyoubdu wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> i dont think that it is one bug.</code></pre>
</blockquote>
<p>I do not understand what you are saying, could you please rephrase/elaborate your message?</p>
<p>Best Regards,<br />
Filip</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> ------------------ Original ------------------
From: "Filip Roséen";<filip@atch.se>;
Send time: Tuesday, Feb 7, 2017 9:35 AM
To: "vlc-devel"<vlc-devel@videolan.org>;
Subject: [vlc-devel] [PATCH] packetizer/h264: fix resource deallocationduring Close
The previous loop condition suffers from an off-by-one error, meaning
that the last resource in p_sys->pp_sps and p_sys->pp_pps would never
be released if populated.
fixes #17987
--
Personally I am not a big fan of loop-conditions such as these (fixed)
ones (because they are very error-prone), though given that this is
the aesthetics used in the rest of the relevant translation-unit I
will refrain from refactoring it.
---
modules/packetizer/h264.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 1b455af479..4d2db65f76 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -330,12 +330,12 @@ static void Close( vlc_object_t *p_this )
if( p_sys->p_frame )
block_ChainRelease( p_sys->p_frame );
- for( i = 0; i < H264_SPS_ID_MAX; i++ )
+ for( i = 0; i <= H264_SPS_ID_MAX; i++ )
{
if( p_sys->pp_sps[i] )
block_Release( p_sys->pp_sps[i] );
}
- for( i = 0; i < H264_PPS_ID_MAX; i++ )
+ for( i = 0; i <= H264_PPS_ID_MAX; i++ )
{
if( p_sys->pp_pps[i] )
block_Release( p_sys->pp_pps[i] );
--
2.11.1</code></pre>
</blockquote>
</body>
</html>