[MPlayer-dev-eng] Re: [PATCH] spudec enters indefinite loop with 'His and her circumstances' DVD 1

Tobias Diedrich td at sim.uni-hannover.de
Sun Feb 16 09:49:07 CET 2003


Tobias Diedrich wrote:

> The "His and her Circumstances" DVD has rather fancy subtitles, you can
> choose between 3 english subtitle tracks, 'normal', 'explanations' and 'bot=
> h'.
> spudec doesn't like at least the last one, the cause probably being a
> mastering error. The error happens in the first episode, right at the
> beginning.
> 
> I have attached a patch, which fixes the problem for me, but is probably
> not the solution to the real problem, so if someone with better
> knowledge of spudec.c could have a look at karekano_broken_sid_2.mpg...

A return is missing, SPUtest passed (offset=0, while loop skipped) and
the packet scheduled for processing. As spudec_process_control does not
check packet->size it operates on random data and enters an indefinite
loop. The right solution is of course to add the missing return :-)
(Committed)

diff -u -r1.38 spudec.c
--- spudec.c	24 Jan 2003 10:24:07 -0000	1.38
+++ spudec.c	16 Feb 2003 00:58:03 -0000
@@ -506,6 +524,7 @@
     if (last_packet->size < last_packet->offset + len){
       mp_msg(MSGT_SPUDEC,MSGL_WARN,"SPUasm: invalid fragment\n");
       last_packet->size = last_packet->offset = 0;
+      return;
     } else {
       memcpy(last_packet->data + last_packet->offset, packet_bytes, len);
       last_packet->offset += len;

BTW, gcc complains:

spudec.c: In function `spudec_calc_bbox':
spudec.c:634: warning: comparison of unsigned expression < 0 is always
false
spudec.c:644: warning: comparison of unsigned expression < 0 is always
false
spudec.c: In function `scale_table':
spudec.c:679: warning: comparison between signed and unsigned
spudec.c:679: warning: signed and unsigned type in conditional
expression
spudec.c: In function `spudec_draw_scaled':
spudec.c:1048: warning: comparison of unsigned expression < 0 is always
false
spudec.c:1056: warning: comparison of unsigned expression < 0 is always
false
spudec.c: In function `spudec_new_scaled_vobsub':
spudec.c:1094: warning: unused parameter `frame_width'

-- 
Tobias								PGP: 0x9AC7E0BC
This mail is made of 100% recycled bits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030216/7e1814b5/attachment.pgp>


More information about the MPlayer-dev-eng mailing list