From: zhanquan cen <[email protected]>

CC:  ffmpeg/libavcodec/alac_data.c ffmpeg/libavcodec/aac_ac3_parser.c:97:13: 
warning: variable 'bit_rate' is used uninitialized whenever 'if' condition is 
true [-Wsometimes-uninitialized]
        if (avctx->codec_id != AV_CODEC_ID_AAC) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ffmpeg/libavcodec/aac_ac3_parser.c:160:18: note: uninitialized use occurs here
                (bit_rate - avctx->bit_rate) / s->frame_number;
                 ^~~~~~~~
ffmpeg/libavcodec/aac_ac3_parser.c:97:9: note: remove the 'if' if its condition 
is always false
        if (avctx->codec_id != AV_CODEC_ID_AAC) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ffmpeg/libavcodec/aac_ac3_parser.c:90:21: note: initialize the variable 
'bit_rate' to silence this warning
        int bit_rate;
                    ^
                     = 0

Signed-off-by: zhanquan cen <[email protected]>
---
 libavcodec/aac_ac3_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index 51c801214c..5b015f2843 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -89,7 +89,7 @@ get_next:
     *poutbuf_size = buf_size;
 
     if (got_frame) {
-        int bit_rate;
+        int bit_rate = 0;
 
         /* Due to backwards compatible HE-AAC the sample rate, channel count,
            and total number of samples found in an AAC ADTS header are not
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to