[vlc-commits] va_surface: emit an error if the amount of pictures in the pool is too large

Steve Lhomme git at videolan.org
Fri Nov 29 11:16:34 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Nov 29 11:10:49 2019 +0100| [7d4028f587548b8e937a57d3ccccf8f089c9eef8] | committer: Steve Lhomme

va_surface: emit an error if the amount of pictures in the pool is too large

The way the pool works, it cannot handle more than MAX_SURFACE_COUNT surfaces.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7d4028f587548b8e937a57d3ccccf8f089c9eef8
---

 modules/codec/avcodec/va_surface.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index 2798702f78..63f2205633 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -91,7 +91,10 @@ int va_pool_SetupDecoder(vlc_va_t *va, va_pool_t *va_pool, AVCodecContext *avctx
     msg_Dbg(va, "va_pool_SetupDecoder id %d %dx%d count: %zu", avctx->codec_id, avctx->coded_width, avctx->coded_height, count);
 
     if (count > MAX_SURFACE_COUNT)
+    {
+        msg_Err(va, "too many surfaces requested %zu (max %d)", count, MAX_SURFACE_COUNT);
         return VLC_EGENERIC;
+    }
 
     int err = va_pool->callbacks.pf_create_decoder_surfaces(va, avctx->codec_id, fmt, count);
     if (err != VLC_SUCCESS)



More information about the vlc-commits mailing list