diff libmpcodecs/vd_ffmpeg.c @ 35040:560a69dffd71

Detect broken mpi usage count also in decoder.
author reimar
date Fri, 31 Aug 2012 20:08:44 +0000
parents 3967b253e915
children ce52aa2b4853
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++){