[XviD-devel] Bug and fix in encoder

Felipe Contreras felipe.contreras at gmail.com
Thu Feb 8 07:50:55 CET 2007


Hi everyone,

In encoder.c you are doing:

stats->type = XVID_TYPE_NOTHING;

But stats might be NULL.

It's only reproducible when:

! XVID_GLOBAL_PACKED
max_bframes > 0
stats = NULL

The fix is attached.

Best Regards.

-- 
Felipe Contreras

--- src/encoder.c	2006-07-10 10:05:30.000000000 -0500
+++ src/encoder.c	2007-02-06 02:16:11.000000000 -0600
@@ -1225,8 +1225,9 @@ repeat:
 		if (pEnc->current->stamp > 0) {
 			call_plugins(pEnc, pEnc->reference, &pEnc->sOriginal,
XVID_PLG_AFTER, NULL, NULL, stats);
 		}
-		else
+		else if (stats) {
 			stats->type = XVID_TYPE_NOTHING;
+		}
 	}

 	/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


More information about the XviD-devel mailing list