All pastes #513045 Raw Edit

mpegaudiodec.c.diff

public c v1 · immutable
#513045 ·published 2007-05-27 02:55 UTC
rendered paste body
Index: libs/libavcodec/mpegaudiodec.c===================================================================--- libs/libavcodec/mpegaudiodec.c  (revision 13500)+++ libs/libavcodec/mpegaudiodec.c  (working copy)@@ -2591,19 +2591,21 @@     if(s->frame_size<=0 || s->frame_size > buf_size){         av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");         return -1;-    }else if(s->frame_size < buf_size){+    }else if((s->frame_size < buf_size) && ((buf_size % s->frame_size) != 0)){         av_log(avctx, AV_LOG_ERROR, "incorrect frame size\n");     } -    out_size = mp_decode_frame(s, out_samples, buf, buf_size);+    out_size = mp_decode_frame(s, out_samples, buf, s->frame_size);     if(out_size>=0){         *data_size = out_size;         avctx->sample_rate = s->sample_rate;         //FIXME maybe move the other codec info stuff from above here too     }else         av_log(avctx, AV_LOG_DEBUG, "Error while decoding MPEG audio frame.\n"); //FIXME return -1 / but also return the number of bytes consumed++    int ret = s->frame_size;     s->frame_size = 0;-    return buf_size;+    return ret; } static void flush(AVCodecContext *avctx){