summaryrefslogtreecommitdiffstats
path: root/libavcodec/hnm4video.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-11-24 01:04:39 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-25 02:00:06 +0000
commit16158da9607f2f84232d3dd381406b2f2449ec74 (patch)
treecaecad8a68b59851911e6636698ec9f393155cea /libavcodec/hnm4video.c
parent51946d2de8bd4a4aada43b6ab41340b0f5eb4ecb (diff)
downloadffmpeg-streaming-16158da9607f2f84232d3dd381406b2f2449ec74.zip
ffmpeg-streaming-16158da9607f2f84232d3dd381406b2f2449ec74.tar.gz
hnm4: Use av_image_check_size
As done for all the other codecs not calling it indirectly. CC: libav-stable@libav.org Bug-Id: CID 1135770 / CID 1135771
Diffstat (limited to 'libavcodec/hnm4video.c')
-rw-r--r--libavcodec/hnm4video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c
index b200e89..4220202 100644
--- a/libavcodec/hnm4video.c
+++ b/libavcodec/hnm4video.c
@@ -22,6 +22,7 @@
#include <string.h>
+#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
@@ -406,6 +407,7 @@ static int hnm_decode_frame(AVCodecContext *avctx, void *data,
static av_cold int hnm_decode_init(AVCodecContext *avctx)
{
Hnm4VideoContext *hnm = avctx->priv_data;
+ int ret;
if (avctx->extradata_size < 1) {
av_log(avctx, AV_LOG_ERROR,
@@ -413,6 +415,10 @@ static av_cold int hnm_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
+ ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+ if (ret < 0)
+ return ret;
+
hnm->version = avctx->extradata[0];
avctx->pix_fmt = AV_PIX_FMT_PAL8;
hnm->width = avctx->width;
OpenPOWER on IntegriCloud