summaryrefslogtreecommitdiff
path: root/libavformat/hdsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-11 20:17:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-11 20:23:31 +0100
commit6722e564a82bac471d92b02550b5017c09b539ba (patch)
tree9d67d253d2f60ba09d68b312bd63051f85933c83 /libavformat/hdsenc.c
parentd6c5fd9f15c1c6e2f5dc8131bffe8997eee7aa6b (diff)
avformat/hdsenc: fix off by 1 error in array size check
Fixes CID1135763, CID1135764 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hdsenc.c')
-rw-r--r--libavformat/hdsenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 7569b8f39c..6679a1795f 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -89,7 +89,7 @@ static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size)
if (size > buf_size)
return AVERROR_INVALIDDATA;
if (type == 8 || type == 9) {
- if (os->nb_extra_packets > FF_ARRAY_ELEMS(os->extra_packets))
+ if (os->nb_extra_packets >= FF_ARRAY_ELEMS(os->extra_packets))
return AVERROR_INVALIDDATA;
os->extra_packet_sizes[os->nb_extra_packets] = size;
os->extra_packets[os->nb_extra_packets] = av_malloc(size);