[libdvbpsi-devel] [PATCH] SEGV fixed in dvbpsi_decoder_psi_section_add
Jean-Paul Saman
jpsaman at videolan.org
Wed Oct 31 09:36:54 CET 2012
Michael,
The patch looks good. Do you have a test file for me to try?
On Tue, Oct 30, 2012 at 3:11 PM, Michael Kasch - SmartCast
<kasch at smartcast.de> wrote:
> Dear Jean-Paul,
> i think i found the Problem for the SEGV still occuring.
>
> please find the Patch attached.
>
> Regards,
> Michael
>
> From 6eaca9164219365e4003099df53399f195829c28 Mon Sep 17 00:00:00 2001
> From: Michael Kasch <michael.kasch at gmail.com>
> Date: Tue, 30 Oct 2012 15:00:53 +0100
> Subject: [PATCH] src/dvbpsi.c: fix segmentation fault in
> dvbpsi_decoder_psi_section_add()
>
> When p->i_number == p_section->i_number AND p_prev == NULL, then the
> first element of the list has to be replaced. Since it is the first
> element we have to update the pointer to the list, which is pointing to
> the first element
> ---
> src/dvbpsi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/dvbpsi.c b/src/dvbpsi.c
> index d45802e..0555b14 100644
> --- a/src/dvbpsi.c
> +++ b/src/dvbpsi.c
> @@ -272,6 +272,7 @@ bool dvbpsi_decoder_psi_section_add(dvbpsi_decoder_t *p_decoder, dvbpsi_psi_sect
> p->p_next = NULL;
> dvbpsi_DeletePSISections(p);
> p = p_section;
In this case p points to the head of the list ( p =
p_decoder->p_sections), so p = p_section should do the trick.
However I wonder if an compiler optimization causes the crash to happen.
> + p_decoder->p_sections = p;
> b_overwrite = true;
> }
> goto out;
> --
> 1.7.10.4
> _______________________________________________
> libdvbpsi-devel mailing list
> libdvbpsi-devel at videolan.org
> http://mailman.videolan.org/listinfo/libdvbpsi-devel
Kind regards,
Jean-Paul Saman
More information about the libdvbpsi-devel
mailing list