Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-26 02:55:06 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-12-26 03:11:49 +0400
commit26ce266e3df8d50b0e6b3b402f2436903424c30c (patch)
treed41def4612a1551f19389ff95f5f3a90c8b01dd4 /libavformat/mpc8.c
parente33b6ccfa782c6e04bcc5ef1b5138ad2a923f620 (diff)
avformat/mpc8: check avio_read() return in mpc8_parse_seektable()
no sample / testcase known Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpc8.c')
-rw-r--r--libavformat/mpc8.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 502eaffe09..b32bc9c354 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -136,7 +136,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
int tag;
int64_t size, pos, ppos[2];
uint8_t *buf;
- int i, t, seekd;
+ int i, t, seekd, ret;
GetBitContext gb;
if (s->nb_streams == 0) {
@@ -156,7 +156,12 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
}
if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
return;
- avio_read(s->pb, buf, size);
+ ret = avio_read(s->pb, buf, size);
+ if (ret != size) {
+ av_log(s, AV_LOG_ERROR, "seek table truncated\n");
+ av_free(buf);
+ return;
+ }
memset(buf+size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&gb, buf, size * 8);