changeset 6673:679b9ef6f5f3 libavcodec

Make sure some value is always returned via data_size
author mbardiaux
date Fri, 25 Apr 2008 13:25:11 +0000
parents 79984fdb1203
children d9d71b8e66a9
files libgsm.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;