Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
| ... | ... |
@@ -35,6 +35,7 @@ |
| 35 | 35 |
#include "libavcodec/mpegaudiodecheader.h" |
| 36 | 36 |
#include "libavformat/avio_internal.h" |
| 37 | 37 |
#include "libavutil/dict.h" |
| 38 |
+#include "libavutil/avassert.h" |
|
| 38 | 39 |
|
| 39 | 40 |
static int id3v1_set_string(AVFormatContext *s, const char *key, |
| 40 | 41 |
uint8_t *buf, int buf_size) |
| ... | ... |
@@ -157,7 +158,7 @@ static int mp3_write_xing(AVFormatContext *s) |
| 157 | 157 |
AVCodecContext *codec = s->streams[0]->codec; |
| 158 | 158 |
MP3Context *mp3 = s->priv_data; |
| 159 | 159 |
int bitrate_idx; |
| 160 |
- int best_bitrate_idx; |
|
| 160 |
+ int best_bitrate_idx = -1; |
|
| 161 | 161 |
int best_bitrate_error= INT_MAX; |
| 162 | 162 |
int64_t xing_offset; |
| 163 | 163 |
int32_t header, mask; |
| ... | ... |
@@ -196,6 +197,7 @@ static int mp3_write_xing(AVFormatContext *s) |
| 196 | 196 |
best_bitrate_idx = bitrate_idx; |
| 197 | 197 |
} |
| 198 | 198 |
} |
| 199 |
+ av_assert0(best_bitrate_idx >= 0); |
|
| 199 | 200 |
|
| 200 | 201 |
for (bitrate_idx= best_bitrate_idx;; bitrate_idx++) {
|
| 201 | 202 |
if (15 == bitrate_idx) |