<div dir="ltr">When creating a subpicture with update functions, private data is also created, otherwise it left null.<br>When calling subpicture update, there was an assumption that private data was created if the subpicture contains update functions.<br>
<br>Subfilter2 may want to modify the subpicture update functions. so there may be a situation that subpicture is created without update functions (and private data) but eventually will have update functions (without private data), and the assumption will be wrong.<br>
<br>Maybe the right solution is that subfilters2 will re-create subpictures with their own update functions, but it seems to me like too much overhead.<br><br><br><div class="gmail_quote">2011/3/25 Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>On Fri, 25 Mar 2011 00:22:50 +0200, Yuval Tze <<a href="mailto:yuvaltze@gmail.com" target="_blank">yuvaltze@gmail.com</a>> wrote:<br>
> check that the private data is not null before accessing it.<br>
<br>
</div>Is it because private is NULL for sub, and non-NULL for sub2? It would be<br>
nice to include an explanatory comment in the patch for future generations<br>
of VLC developers ;-)<br>
<div><div></div><div><br>
> ---<br>
> src/misc/subpicture.c | 10 +++++-----<br>
> 1 files changed, 5 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/src/misc/subpicture.c b/src/misc/subpicture.c<br>
> index 3e84a27..a1ee386 100644<br>
> --- a/src/misc/subpicture.c<br>
> +++ b/src/misc/subpicture.c<br>
> @@ -152,11 +152,11 @@ void subpicture_Update( subpicture_t<br>
*p_subpicture,<br>
> if( !p_upd->pf_validate )<br>
> return;<br>
> if( !p_upd->pf_validate( p_subpicture,<br>
> - !video_format_IsSimilar( p_fmt_src,<br>
> - &p_private->src ),<br>
> p_fmt_src,<br>
> - !video_format_IsSimilar( p_fmt_dst,<br>
> - &p_private->dst ),<br>
> p_fmt_dst,<br>
> - i_ts ) )<br>
> + p_private ? !video_format_IsSimilar(<br>
> p_fmt_src, &p_private->src ) : false,<br>
> + p_fmt_src,<br>
> + p_private ? !video_format_IsSimilar(<br>
> p_fmt_dst, &p_private->dst ) : false,<br>
> + p_fmt_dst,<br>
> + i_ts ) )<br>
> return;<br>
><br>
> subpicture_region_ChainDelete( p_subpicture->p_region );<br>
<br>
--<br>
</div></div><font color="#888888">Rémi Denis-Courmont<br>
<a href="http://www.remlab.net/" target="_blank">http://www.remlab.net/</a><br>
</font></blockquote></div><br></div>