X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ftarga.c;h=11a8f213fd6bb100cdd82ad242c967fe03c45a43;hb=51e9d2dbc8f8e7aed216222a496cc7e588afa217;hp=18ad21d0360e06243e73ef298d1d52e7014a80ef;hpb=a646ac8ef5c51d6a47eb564d58d04564c0489871;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;