diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-12-03 22:22:18 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-12-03 22:22:18 +0100 |
commit | 1f9a4deaa4f924f364aee10842565835bcf9c47b (patch) | |
tree | 6b745f5a4d1fe912dff6422967a10c1104c15cc8 /plugins/aac | |
parent | 473d98a9cffea603ccc3ab62a0872e0058524eb3 (diff) |
aac: don't crash when numsamples is 0
Diffstat (limited to 'plugins/aac')
-rw-r--r-- | plugins/aac/aac.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index 32f4fd0e..a711621b 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -253,8 +253,13 @@ mp4_track_get_info(mp4ff_t *mp4, int track, float *duration, int *samplerate, in samples = (int64_t)mp4ff_num_samples(mp4, track); NeAACDecClose (dec); + dec = NULL; - int i_sample_count = mp4ff_num_samples (mp4, track); + if (samples <= 0) { + goto error; + } + + int i_sample_count = samples; int i_sample; int64_t total_dur = 0; |