X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favs.c;h=e3d2070bb797938bcb9c018406b007b080071bc9;hb=48d30f6733368f317a61901c61a78a10402eea7b;hp=0881d7417e5b5bb6265e872e9ecf5552009c37a6;hpb=39d178806d9111e0e4a1e9400d4df0d00093ad00;p=ffmpeg diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 0881d7417e5..e3d2070bb79 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -54,14 +54,14 @@ avs_decode_frame(AVCodecContext * avctx, AVFrame *const p = &avs->picture; const uint8_t *table, *vect; uint8_t *out; - int i, j, x, y, stride, vect_w = 3, vect_h = 3; + int i, j, x, y, stride, ret, vect_w = 3, vect_h = 3; AvsVideoSubType sub_type; AvsBlockType type; - GetBitContext change_map; + GetBitContext change_map = {0}; //init to silence warning - if (avctx->reget_buffer(avctx, p)) { + if ((ret = avctx->reget_buffer(avctx, p)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); - return -1; + return ret; } p->reference = 3; p->pict_type = AV_PICTURE_TYPE_P; @@ -96,7 +96,7 @@ avs_decode_frame(AVCodecContext * avctx, } if (type != AVS_VIDEO) - return -1; + return AVERROR_INVALIDDATA; switch (sub_type) { case AVS_I_FRAME: @@ -118,7 +118,7 @@ avs_decode_frame(AVCodecContext * avctx, break; default: - return -1; + return AVERROR_INVALIDDATA; } if (buf_end - buf < 256 * vect_w * vect_h)