[11/18] ivi_common: Make sure color planes have been initialized

Message ID 1379358389-64839-11-git-send-email-martin@martin.st
State Committed
Commit a92538b7c0defc86c55fb91f55dfa36aad192673
Headers show

Commit Message

Martin Storsjö Sept. 16, 2013, 7:06 p.m.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
---
 libavcodec/ivi_common.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Luca Barbato Sept. 16, 2013, 9:39 p.m. | #1
On 16/09/13 21:06, Martin Storsjö wrote:
> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: libav-stable@libav.org
> ---
>  libavcodec/ivi_common.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 

Ok.

Patch

diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index 2207fe1..7ca53b7 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -970,6 +970,11 @@  int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_PATCHWELCOME;
     }
 
+    if (!ctx->planes[0].bands) {
+        av_log(avctx, AV_LOG_ERROR, "Color planes not initialized yet\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     ctx->switch_buffers(ctx);
 
     //{ START_TIMER;