changeset 35040:560a69dffd71

Detect broken mpi usage count also in decoder.
author reimar
date Fri, 31 Aug 2012 20:08:44 +0000
parents 848835e1b053
children f674ec17b65b
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Fri Aug 31 19:52:31 2012 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Fri Aug 31 20:08:44 2012 +0000
@@ -707,6 +707,10 @@
     if (mpi) {
         // release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU)
         mpi->usage_count--;
+        if (mpi->usage_count < 0) {
+            mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Bad mp_image usage count, please report!\n");
+            mpi->usage_count = 0;
+        }
     }
 
     for(i=0; i<4; i++){