changeset 3164:d771383fbcb8 libavcodec

Make faac_decode_frame return -1 on error and not 0 which avoids stalling and infinite loop. Patch by Baptiste COUDURIER <baptiste coudurier at smartjog com>
author mru
date Sun, 05 Mar 2006 12:32:24 +0000
parents b67ef5ea4d99
children 8b51e108cba6
files faad.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/faad.c	Sat Mar 04 19:56:01 2006 +0000
+++ b/faad.c	Sun Mar 05 12:32:24 2006 +0000
@@ -164,7 +164,7 @@
         if(r < 0){
             av_log(avctx, AV_LOG_ERROR, "faac: codec init failed: %s\n",
                    s->faacDecGetErrorMessage(frame_info.error));
-            return 0;
+            return -1;
         }
         avctx->sample_rate = srate;
         avctx->channels = channels;
@@ -176,7 +176,7 @@
     if (frame_info.error > 0) {
         av_log(avctx, AV_LOG_ERROR, "faac: frame decoding failed: %s\n",
                 s->faacDecGetErrorMessage(frame_info.error));
-        return 0;
+        return -1;
     }
 
     frame_info.samples *= s->sample_size;