Another infinite loop in oggplay_step_decoding

RESOLVED FIXED

Status

()

Core
Audio/Video
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: roc, Assigned: cajbir)

Tracking

({fixed1.9.1})

Trunk
x86
Mac OS X
fixed1.9.1
Points:
---
Bug Flags:
blocking1.9.1 +
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 378239 [details]
testcase

Try loading the attached testcase. It never finished playing because the step-decode thread gets into an infinite loop in oggplay_step_decoding.
Infinite loops in the decoder are incredibly bad. They just make the browser silently and inexplicably slower until the user restarts.
Flags: blocking1.9.1+
(Assignee)

Comment 2

9 years ago
Created attachment 378281 [details] [diff] [review]
Fix

liboggplay keeps a count of the number of active tracks in the main oggplay datastructure. Decoders start out intialized as active but the active track count starts at 0.

In this example the theora track hits end of stream before our code goes through and marks tracks as active. So the active count goes from zero to -1. We then bump it up to 1 (adding the two tracks we make active). The theora track, since it has just been made active again, notices it's at end of stream and decrements to zero. Then the vorbis track drops it to -1. 

The code to break out of the step_decode loop when all tracks are inactive (active count is zero) never fires.

Fix by making decoders inactive to start.
Assignee: nobody → chris.double
Status: NEW → ASSIGNED
(Assignee)

Comment 3

9 years ago
Checking to get Viktor's comments before needing landing.
(Assignee)

Comment 4

9 years ago
Raised trac ticket 477 for this:

https://trac.annodex.net/ticket/477

Discussed with Viktor last night and should be ok to land.
Whiteboard: [needs landing]
http://hg.mozilla.org/mozilla-central/rev/c3bf078aded1

We should check in the testcase.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 landing]
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/b4bdfa1208eb
Keywords: fixed1.9.1
Whiteboard: [needs 191 landing]
Depends on: 500311
You need to log in before you can comment on or make changes to this bug.