Commit 2bf09826 authored by Michael Niedermayer's avatar Michael Niedermayer

loco: Fix error handling.

Fixes null pointer dereference / http://www.google-melange.com/gci/task/view/google/gci2011/7120335Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 58030fc6
...@@ -123,6 +123,9 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh ...@@ -123,6 +123,9 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
int val; int val;
int i, j; int i, j;
if(buf_size<=0)
return -1;
init_get_bits(&rc.gb, buf, buf_size*8); init_get_bits(&rc.gb, buf, buf_size*8);
rc.save = 0; rc.save = 0;
rc.run = 0; rc.run = 0;
...@@ -225,7 +228,7 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -225,7 +228,7 @@ static int decode_frame(AVCodecContext *avctx,
*data_size = sizeof(AVFrame); *data_size = sizeof(AVFrame);
*(AVFrame*)data = l->pic; *(AVFrame*)data = l->pic;
return buf_size; return buf_size < 0 ? -1 : buf_size;
} }
static av_cold int decode_init(AVCodecContext *avctx){ static av_cold int decode_init(AVCodecContext *avctx){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment