aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-02-09 21:55:56 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-10 18:05:01 -0500
commit0b1d291a716dd79ca6862a95baf9ac574feba885 (patch)
tree0b7111bd98f351331b34a3219f749bd685b56298 /libavformat/asfdec.c
parentc1fea2307011ac7a7bb98af98010f81abc789732 (diff)
downloadffmpeg-0b1d291a716dd79ca6862a95baf9ac574feba885.tar.gz
asfdec: deobfuscate reading video properties size
This code will be later split out into a function which takes a 'size' argument, so I'm keeping the name 'sizeX' here. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r--libavformat/asfdec.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index cd051ad51a..0ee6667a27 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -398,7 +398,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
ByteIOContext *pb = s->pb;
AVStream *st;
ASFStream *asf_st;
- int size, i;
+ int i;
int64_t gsize;
ff_get_guid(pb, &g);
@@ -559,7 +559,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
get_le32(pb);
get_le32(pb);
get_byte(pb);
- size = get_le16(pb); /* size */
+ get_le16(pb); /* size */
sizeX= get_le32(pb); /* size */
st->codec->width = get_le32(pb);
st->codec->height = get_le32(pb);
@@ -569,9 +569,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
tag1 = get_le32(pb);
url_fskip(pb, 20);
// av_log(s, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX);
- size= sizeX;
- if (size > 40) {
- st->codec->extradata_size = size - 40;
+ if (sizeX > 40) {
+ st->codec->extradata_size = sizeX - 40;
st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
}