You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
vp9: error out if chroma subsampling changes between frames.
This can happen after an intra-only frame. For reference, see: https://groups.google.com/a/webmproject.org/forum/#!msg/webm-discuss/zaoTxREZjq8/v5Enht87AhcJ Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
9d4fdfe24c
commit
ed68fccf76
@@ -31,6 +31,7 @@
|
|||||||
#include "vp9data.h"
|
#include "vp9data.h"
|
||||||
#include "vp9dsp.h"
|
#include "vp9dsp.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
|
#include "libavutil/pixdesc.h"
|
||||||
|
|
||||||
#define VP9_SYNCCODE 0x498342
|
#define VP9_SYNCCODE 0x498342
|
||||||
|
|
||||||
@@ -641,7 +642,13 @@ static int decode_frame_header(AVCodecContext *ctx,
|
|||||||
AVFrame *ref = s->refs[s->refidx[i]].f;
|
AVFrame *ref = s->refs[s->refidx[i]].f;
|
||||||
int refw = ref->width, refh = ref->height;
|
int refw = ref->width, refh = ref->height;
|
||||||
|
|
||||||
if (refw == w && refh == h) {
|
if (ref->format != fmt) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
|
"Ref pixfmt (%s) did not match current frame (%s)",
|
||||||
|
av_get_pix_fmt_name(ref->format),
|
||||||
|
av_get_pix_fmt_name(fmt));
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
} else if (refw == w && refh == h) {
|
||||||
s->mvscale[i][0] = s->mvscale[i][1] = 0;
|
s->mvscale[i][0] = s->mvscale[i][1] = 0;
|
||||||
} else {
|
} else {
|
||||||
if (w * 2 < refw || h * 2 < refh || w > 16 * refw || h > 16 * refh) {
|
if (w * 2 < refw || h * 2 < refh || w > 16 * refw || h > 16 * refh) {
|
||||||
|
Reference in New Issue
Block a user