Replace two asserts by checks and error messages.
authorDiego Biurrun <diego@biurrun.de>
Mon, 16 Feb 2009 02:02:49 +0000 (02:02 +0000)
committerDiego Biurrun <diego@biurrun.de>
Mon, 16 Feb 2009 02:02:49 +0000 (02:02 +0000)
Originally committed as revision 17362 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegvideo_xvmc.c

index 7815740..06c7bfc 100644 (file)
@@ -312,11 +312,14 @@ void ff_xvmc_decode_mb(MpegEncContext *s)
     }
     render->filled_mv_blocks_num++;
 
-    assert(render->filled_mv_blocks_num     <= render->allocated_mv_blocks);
-    assert(render->next_free_data_block_num <= render->allocated_data_blocks);
-    /* The above conditions should not be able to fail as long as this function
-     * is used and the following 'if ()' automatically calls a callback to free
-     * blocks. */
+
+    if (render->filled_mv_blocks_num > render->allocated_mv_blocks)
+        av_log(s->avctx, AV_LOG_ERROR,
+               "Not enough space to store mv blocks allocated.\n");
+
+    if (render->next_free_data_block_num > render->allocated_data_blocks)
+        av_log(s->avctx, AV_LOG_ERROR,
+               "Offset to next data block exceeds number of allocated data blocks.\n");
 
 
     if (render->filled_mv_blocks_num == render->allocated_mv_blocks)