From 202aca676f09b803645a6f32715162c76a41d772 Mon Sep 17 00:00:00 2001 From: Michel Bardiaux Date: Fri, 25 Apr 2008 13:25:11 +0000 Subject: Make sure some value is always returned via data_size Originally committed as revision 12955 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/libgsm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libavcodec/libgsm.c') diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 82e00b1f51..995b467616 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -121,9 +121,8 @@ AVCodec libgsm_ms_encoder = { 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; -- cgit v1.2.3