Commit 147f2e91 authored by Vittorio Giovara's avatar Vittorio Giovara

avcodec: make sure color_range is properly initialized

parent 04d14c9b
...@@ -1189,6 +1189,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code ...@@ -1189,6 +1189,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto free_and_end; 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) { if (avctx->codec->supported_samplerates) {
for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++) for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment