ivi_common: Make sure color planes have been initialized

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a92538b7c0defc86c55fb91f55dfa36aad192673)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 38bd229af9c4fa5897fc1a69e73a04c55f78647f)
This commit is contained in:
Martin Storsjö 2013-09-16 20:32:35 +03:00 committed by Luca Barbato
parent 33b88170d7
commit 843b330c3c

View File

@ -892,6 +892,11 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return AVERROR_PATCHWELCOME; 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); ctx->switch_buffers(ctx);
//{ START_TIMER; //{ START_TIMER;