summaryrefslogtreecommitdiff
path: root/chromium/third_party/ffmpeg/libavcodec/dxv.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/ffmpeg/libavcodec/dxv.c')
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxv.c b/chromium/third_party/ffmpeg/libavcodec/dxv.c
index 6fe5516505a..ae79de981f7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxv.c
@@ -745,6 +745,9 @@ static int dxv_decompress_cocg(DXVContext *ctx, GetByteContext *gb,
int skip0, skip1, oi0 = 0, oi1 = 0;
int ret, state0 = 0, state1 = 0;
+ if (op_offset < 12)
+ return AVERROR_INVALIDDATA;
+
dst = tex_data;
bytestream2_skip(gb, op_offset - 12);
if (op_size0 > max_op_size0)
@@ -1054,6 +1057,10 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
avctx->pix_fmt = AV_PIX_FMT_RGBA;
avctx->colorspace = AVCOL_SPC_RGB;
+ ctx->tex_funct = NULL;
+ ctx->tex_funct_planar[0] = NULL;
+ ctx->tex_funct_planar[1] = NULL;
+
tag = bytestream2_get_le32(gbc);
switch (tag) {
case MKBETAG('D', 'X', 'T', '1'):