summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-08 22:37:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-08 22:37:31 +0200
commit78d7d8fe9170f38ee0b2ab6f731ff1a61c712db5 (patch)
tree3fa4f47e3f1cca5a0cf39b42a5d171dec9a5b53f /libavformat
parent04c13dca8812e8302686887b6e8201d4ad25b7d8 (diff)
parent6376362d15ccbc02e15d0b3b7a7a5d862efd6b91 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: Employ FF_ARRAY_ELEMS instead of manually calculating array length. Fixed invalid access in wavpack decoder on corrupted bitstream. Fixed invalid writes in wavpack decoder on corrupted bitstreams. Fixed invalid access in wavpack decoder on corrupted extra bits sub-blocks. rtpdec_asf: Fix integer underflow that could allow remote code execution Conflicts: libavformat/rtpdec_asf.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avlanguage.c3
-rw-r--r--libavformat/mxf.c3
-rw-r--r--libavformat/rtpdec_asf.c10
3 files changed, 9 insertions, 7 deletions
diff --git a/libavformat/avlanguage.c b/libavformat/avlanguage.c
index 525bf07d27..39f2560d94 100644
--- a/libavformat/avlanguage.c
+++ b/libavformat/avlanguage.c
@@ -20,6 +20,7 @@
#include "avlanguage.h"
#include "libavutil/avstring.h"
+#include "libavutil/common.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -736,7 +737,7 @@ const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_cod
{
int i;
const LangEntry *entry = NULL;
- const int NB_CODESPACES = sizeof(lang_table_counts)/sizeof(*lang_table_counts);
+ const int NB_CODESPACES = FF_ARRAY_ELEMS(lang_table_counts);
if (target_codespace >= NB_CODESPACES)
return NULL;
diff --git a/libavformat/mxf.c b/libavformat/mxf.c
index d7e95eebfc..1b85a894ce 100644
--- a/libavformat/mxf.c
+++ b/libavformat/mxf.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/common.h"
#include "mxf.h"
/**
@@ -81,7 +82,7 @@ static const struct {
{PIX_FMT_PAL8, {'P', 8 }},
};
-static const int num_pixel_layouts = sizeof(ff_mxf_pixel_layouts) / sizeof(*ff_mxf_pixel_layouts);
+static const int num_pixel_layouts = FF_ARRAY_ELEMS(ff_mxf_pixel_layouts);
int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt)
{
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index 643ea7a5a0..b481c37c82 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -233,14 +233,14 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
int cur_len = start_off + len_off - off;
int prev_len = out_len;
- void *newbuf;
+ void *newmem;
out_len += cur_len;
- if(FFMIN(cur_len, len - off)<0)
+ if (FFMIN(cur_len, len - off) < 0)
return -1;
- newbuf = av_realloc(asf->buf, out_len);
- if(!newbuf)
+ newmem = av_realloc(asf->buf, out_len);
+ if (!newmem)
return -1;
- asf->buf= newbuf;
+ asf->buf = newmem;
memcpy(asf->buf + prev_len, buf + off,
FFMIN(cur_len, len - off));
avio_skip(pb, cur_len);