X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Floco.c;h=75701e970b7e012fb5b1acded55ab547d76c39fd;hb=107f55cb01d2333541b8887194c487a6c6bc1ba1;hp=505f566ba6a0e13d0036b6c8607cd1aefc9409c8;hpb=6ace8374bacf33e5f3407cb50e928e7533eb5e92;p=ffmpeg diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 505f566ba6a..75701e970b7 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -123,6 +123,9 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh int val; int i, j; + if(buf_size<=0) + return -1; + init_get_bits(&rc.gb, buf, buf_size*8); rc.save = 0; rc.run = 0; @@ -225,7 +228,7 @@ static int decode_frame(AVCodecContext *avctx, *data_size = sizeof(AVFrame); *(AVFrame*)data = l->pic; - return buf_size; + return buf_size < 0 ? -1 : buf_size; } static av_cold int decode_init(AVCodecContext *avctx){