aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-25 12:16:07 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-25 12:19:08 +0100
commitba1a19bc35e4a6b9dc421feb92e3f15fa16adb8b (patch)
tree2a3dfa598ce8a7a27a766b2a44431f68d840bc77
parent0e85a28fa434385d6a0465bf44b95f8820683f56 (diff)
parent16158da9607f2f84232d3dd381406b2f2449ec74 (diff)
downloadffmpeg-ba1a19bc35e4a6b9dc421feb92e3f15fa16adb8b.tar.gz
Merge commit '16158da9607f2f84232d3dd381406b2f2449ec74'
* commit '16158da9607f2f84232d3dd381406b2f2449ec74': hnm4: Use av_image_check_size See: e23b18321fb5cffb6e05d0b0ef00de9733f560da Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/hnm4video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c
index d8c51d0b75..31995bc75c 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"
@@ -453,6 +454,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,
@@ -460,6 +462,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;