changeset 4114:aeb27b09de8e

Check for NULL vob->spudec before using.
author kmkaplan
date Sat, 12 Jan 2002 18:34:50 +0000
parents 1b61c1c982ae
children 1de4b71cab3a
files vobsub.c
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/vobsub.c	Sat Jan 12 18:26:13 2002 +0000
+++ b/vobsub.c	Sat Jan 12 18:34:50 2002 +0000
@@ -754,18 +754,19 @@
 {
     vobsub_t *vob = (vobsub_t *)vobhandle;
     unsigned int pts100 = 100 * pts;
-    if (vob->spudec)
+    if (vob->spudec) {
 	spudec_heartbeat(vob->spudec, pts100);
-    if (vob->spu_streams && 0 <= vobsub_id && (unsigned) vobsub_id < vob->spu_streams_size) {
-	packet_queue_t *queue = vob->spu_streams + vobsub_id;
-	while (queue->current_index < queue->packets_size) {
-	    packet_t *pkt = queue->packets + queue->current_index;
-	    if (pkt->pts100 <= pts100) {
-		spudec_assemble(vob->spudec, pkt->data, pkt->size, pkt->pts100);
-		++queue->current_index;
+	if (vob->spu_streams && 0 <= vobsub_id && (unsigned) vobsub_id < vob->spu_streams_size) {
+	    packet_queue_t *queue = vob->spu_streams + vobsub_id;
+	    while (queue->current_index < queue->packets_size) {
+		packet_t *pkt = queue->packets + queue->current_index;
+		if (pkt->pts100 <= pts100) {
+		    spudec_assemble(vob->spudec, pkt->data, pkt->size, pkt->pts100);
+		    ++queue->current_index;
+		}
+		else
+		    break;
 	    }
-	    else
-		break;
 	}
     }
 }