aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libgsm.c
diff options
context:
space:
mode:
authorMichel Bardiaux <mbardiaux@mediaxim.be>2008-04-25 13:25:11 +0000
committerMichel Bardiaux <mbardiaux@mediaxim.be>2008-04-25 13:25:11 +0000
commit202aca676f09b803645a6f32715162c76a41d772 (patch)
treefca48f822f05232d2e55122b28897ade23db22b2 /libavcodec/libgsm.c
parent3b8c000d1e85724ad4e2dcc3382a2651978b0109 (diff)
downloadffmpeg-202aca676f09b803645a6f32715162c76a41d772.tar.gz
Make sure some value is always returned via data_size
Originally committed as revision 12955 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libgsm.c')
-rw-r--r--libavcodec/libgsm.c5
1 files changed, 2 insertions, 3 deletions
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;