[MPlayer-dev-eng] [PATCH] vobsub fix

191919 191919 at gmail.com
Wed Jul 21 05:06:49 CEST 2010


1019                                 while (queue->current_index + 1 <
queue->packets_size
1020                                        &&
queue->packets[queue->current_index + 1].filepos <= pos)
1021                                     ++queue->current_index;

The first two pair of queue->packets[queue->current_index + 1].filepos
and pos are:

20480 14
16384 2062

before mplayer crashes. So queue->current_index was never incremented.

2010/7/21 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:
> On Tue, Jul 20, 2010 at 09:10:25PM +0800, 191919 wrote:
>> Here is the new patch generated by "diff -uw".
>
> On the plus side, you patch can only improve things, so it's good.
> Though I think the code is nicer if done liek this:
> Index: vobsub.c
> ===================================================================
> --- vobsub.c    (revision 31758)
> +++ vobsub.c    (working copy)
> @@ -1033,11 +1033,11 @@
>                                             last_pts_diff = pkt->pts100 - mpg->pts;
>                                         else
>                                             pkt->pts100 = mpg->pts;
> -                                        if (mpg->merge) {
> +                                        if (mpg->merge && queue->current_index) {
>                                             packet_t *last = &queue->packets[queue->current_index - 1];
>                                             pkt->pts100 = last->pts100;
> -                                            mpg->merge = 0;
>                                         }
> +                                        mpg->merge = 0;
>                                         /* FIXME: should not use mpg_sub internal informations, make a copy */
>                                         pkt->data = mpg->packet;
>                                         pkt->size = mpg->packet_size;
>
>
> However, I think this only hides the real bug somewhere else, I don't think
> mpg->merge should ever be set when there is no previous packet.
> For example, one bug is that none of the seek/reset functions sets
> mpg->merge to 0.
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>


More information about the MPlayer-dev-eng mailing list