X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ftarga.c;h=11a8f213fd6bb100cdd82ad242c967fe03c45a43;hb=df4203ac6f00bb222e93438967a1e4b6209e7919;hp=18ad21d0360e06243e73ef298d1d52e7014a80ef;hpb=6fc064893270be7549eccc78fd085ca8521ad9f2;p=ffmpeg diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 18ad21d0360..11a8f213fd6 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -178,7 +178,7 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - if ((ret = av_image_check_size(w, h, 0, avctx))) + 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); @@ -200,6 +200,7 @@ static int decode_frame(AVCodecContext *avctx, if (colors) { int pal_size, pal_sample_size; + switch (csize) { case 32: pal_sample_size = 4; break; case 24: pal_sample_size = 3; break;