summaryrefslogtreecommitdiff
path: root/libavcodec/pcx.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/pcx.c')
-rw-r--r--libavcodec/pcx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
index bac818c586..d60e5020c2 100644
--- a/libavcodec/pcx.c
+++ b/libavcodec/pcx.c
@@ -147,8 +147,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (p->data[0])
avctx->release_buffer(avctx, p);
- if (av_image_check_size(w, h, 0, avctx))
- return AVERROR_INVALIDDATA;
+ if ((ret = av_image_check_size(w, h, 0, avctx)) < 0)
+ return ret;
if (w != avctx->width || h != avctx->height)
avcodec_set_dimensions(avctx, w, h);
if ((ret = ff_get_buffer(avctx, p)) < 0) {