Browse Source

Merge commit '16158da9607f2f84232d3dd381406b2f2449ec74'

* commit '16158da9607f2f84232d3dd381406b2f2449ec74':
  hnm4: Use av_image_check_size

See: e23b18321f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.5
Michael Niedermayer 11 years ago
parent
commit
ba1a19bc35
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/hnm4video.c

+ 6
- 0
libavcodec/hnm4video.c View File

@@ -22,6 +22,7 @@


#include <string.h> #include <string.h>


#include "libavutil/imgutils.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@@ -453,6 +454,7 @@ static int hnm_decode_frame(AVCodecContext *avctx, void *data,
static av_cold int hnm_decode_init(AVCodecContext *avctx) static av_cold int hnm_decode_init(AVCodecContext *avctx)
{ {
Hnm4VideoContext *hnm = avctx->priv_data; Hnm4VideoContext *hnm = avctx->priv_data;
int ret;


if (avctx->extradata_size < 1) { if (avctx->extradata_size < 1) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
@@ -460,6 +462,10 @@ static av_cold int hnm_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }


ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
if (ret < 0)
return ret;

hnm->version = avctx->extradata[0]; hnm->version = avctx->extradata[0];
avctx->pix_fmt = AV_PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
hnm->width = avctx->width; hnm->width = avctx->width;


Loading…
Cancel
Save