# HG changeset patch # User mbardiaux # Date 1209129911 0 # Node ID 679b9ef6f5f3e493d011e0861fc5b83813fcc0e1 # Parent 79984fdb1203da67773e8835d78390908eb36225 Make sure some value is always returned via data_size diff -r 79984fdb1203 -r 679b9ef6f5f3 libgsm.c --- a/libgsm.c Fri Apr 25 13:05:15 2008 +0000 +++ b/libgsm.c Fri Apr 25 13:25:11 2008 +0000 @@ -121,9 +121,8 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { - - if(buf_size < avctx->block_align) return 0; - + *data_size = 0; /* In case of error */ + if(buf_size < avctx->block_align) return -1; switch(avctx->codec_id) { case CODEC_ID_GSM: if(gsm_decode(avctx->priv_data,buf,data)) return -1;