aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-20 11:30:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-20 11:30:56 +0100
commitdf804041bd42d79b8cd01d7599c0d1f69c4027ee (patch)
tree41428f2e817f1a92fb67370caa69df844adffc93 /libavcodec
parent17ebef2fc8094a235c0f30ce247c77659ea86539 (diff)
parent6599b087de62a5f9f2a8d61a1952d777d1bff804 (diff)
downloadffmpeg-df804041bd42d79b8cd01d7599c0d1f69c4027ee.tar.gz
Merge commit '6599b087de62a5f9f2a8d61a1952d777d1bff804'
* commit '6599b087de62a5f9f2a8d61a1952d777d1bff804': buffersrc: fix a typo. lavc, lavfi: fix counting number of planes in AVBufferRef wrappers Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e46e907c3a..887f6b143b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -757,11 +757,11 @@ do { \
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
- if (!desc) {
+ planes = av_pix_fmt_count_planes(frame->format);
+ if (!desc || planes <= 0) {
ret = AVERROR(EINVAL);
goto fail;
}
- planes = (desc->flags & PIX_FMT_PLANAR) ? desc->nb_components : 1;
for (i = 0; i < planes; i++) {
int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;