aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-09-26 16:07:55 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-08 18:17:49 +0100
commit147f2e91eece6b9021ff5b7f8a3b5ce053566659 (patch)
tree3c90717f9c2478c8a756ae3c5d8f70987dda8d3a
parent04d14c9b68b03e8dbc6e3003c1ee06892dd32576 (diff)
downloadffmpeg-147f2e91eece6b9021ff5b7f8a3b5ce053566659.tar.gz
avcodec: make sure color_range is properly initialized
-rw-r--r--libavcodec/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 80ba858b23..8ecf358b61 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1189,6 +1189,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
ret = AVERROR(EINVAL);
goto free_and_end;
}
+ if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ420P ||
+ avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ422P ||
+ avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ440P ||
+ avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P)
+ avctx->color_range = AVCOL_RANGE_JPEG;
}
if (avctx->codec->supported_samplerates) {
for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++)