From ac9b056ddbefecf3e68e89af45d9c8e5172a5ff8 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Fri, 22 Mar 2013 01:03:07 +0100 Subject: [PATCH] Do not fail in get_buffer_internal() if pix_fmt planes == 0. Fixes VDPAU decoding, reported by Ilja Sekler --- libavcodec/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c15b7726cb..70c6129f75 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -758,6 +758,8 @@ do { \ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); planes = av_pix_fmt_count_planes(frame->format); + if (!planes) + planes = 1; if (!desc || planes <= 0) { ret = AVERROR(EINVAL); goto fail;