summaryrefslogtreecommitdiff
path: root/libavformat/vividas.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/vividas.c')
-rw-r--r--libavformat/vividas.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 830e318645..c0d39f0a6f 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -386,7 +386,12 @@ static void track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t
offset += av_xiphlacing(&p[offset], data_len[j]);
for (j = 0; j < num_data; j++) {
- avio_read(pb, &p[offset], data_len[j]);
+ int ret = avio_read(pb, &p[offset], data_len[j]);
+ if (ret < data_len[j]) {
+ st->codecpar->extradata_size = 0;
+ av_freep(&st->codecpar->extradata);
+ break;
+ }
offset += data_len[j];
}