Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
2886f176
Commit
2886f176
authored
Dec 11, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix swfdec crash
Close #7860
parent
b5e0afa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
1 deletion
+82
-1
contrib/src/ffmpeg/rules.mak
contrib/src/ffmpeg/rules.mak
+2
-1
contrib/src/ffmpeg/swfdec.patch
contrib/src/ffmpeg/swfdec.patch
+80
-0
No files found.
contrib/src/ffmpeg/rules.mak
View file @
2886f176
...
@@ -126,7 +126,8 @@ ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz .sum-ffmpeg
...
@@ -126,7 +126,8 @@ ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz .sum-ffmpeg
ifdef
HAVE_WIN32
ifdef
HAVE_WIN32
sed
-i
"s/std=c99/std=gnu99/"
$@
-
$(FFMPEG_VERSION)
/configure
sed
-i
"s/std=c99/std=gnu99/"
$@
-
$(FFMPEG_VERSION)
/configure
endif
endif
$(APPLY)
$(SRC)
/ffmpeg/libav.git-a25d912.patch
$(APPLY)
$(SRC)
/ffmpeg/libavcodec-a25d912.patch
$(APPLY)
$(SRC)
/ffmpeg/swfdec.patch
$(MOVE)
$(MOVE)
.ffmpeg
:
ffmpeg
.ffmpeg
:
ffmpeg
...
...
contrib/src/ffmpeg/swfdec.patch
0 → 100644
View file @
2886f176
diff -ruN ffmpeg.old/libavformat/swfdec.c ffmpeg/libavformat/swfdec.c
--- ffmpeg.old/libavformat/swfdec.c 2012-12-11 02:25:55.000000000 +0100
+++ ffmpeg/libavformat/swfdec.c 2012-12-11 02:26:50.000000000 +0100
@@ -100,6 +100,10 @@
tag = get_swf_tag(pb, &len);
if (tag < 0)
return AVERROR(EIO);
+ if (len < 0) {
+ av_log(s, AV_LOG_ERROR, "invalid tag length: %d\n", len);
+ return AVERROR_INVALIDDATA;
+ }
if (tag == TAG_VIDEOSTREAM) {
int ch_id = avio_rl16(pb);
len -= 2;
@@ -155,7 +159,10 @@
st = s->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) {
frame = avio_rl16(pb);
- if ((res = av_get_packet(pb, pkt, len-2)) < 0)
+ len -= 2;
+ if (len <= 0)
+ goto skip;
+ if ((res = av_get_packet(pb, pkt, len)) < 0)
return res;
pkt->pos = pos;
pkt->pts = frame;
@@ -167,17 +174,22 @@
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) {
- if (st->codec->codec_id == AV_CODEC_ID_MP3) {
- avio_skip(pb, 4);
- if ((res = av_get_packet(pb, pkt, len-4)) < 0)
- return res;
- } else { // ADPCM, PCM
- if ((res = av_get_packet(pb, pkt, len)) < 0)
- return res;
- }
- pkt->pos = pos;
- pkt->stream_index = st->index;
- return pkt->size;
+ if (st->codec->codec_id == AV_CODEC_ID_MP3) {
+ avio_skip(pb, 4);
+ len -= 4;
+ if (len <= 0)
+ goto skip;
+ if ((res = av_get_packet(pb, pkt, len)) < 0)
+ return res;
+ } else { // ADPCM, PCM
+ if (len <= 0)
+ goto skip;
+ if ((res = av_get_packet(pb, pkt, len)) < 0)
+ return res;
+ }
+ pkt->pos = pos;
+ pkt->stream_index = st->index;
+ return pkt->size;
}
}
} else if (tag == TAG_JPEG2) {
@@ -197,7 +209,10 @@
st = vst;
}
avio_rl16(pb); /* BITMAP_ID */
- if ((res = av_new_packet(pkt, len-2)) < 0)
+ len -= 2;
+ if (len < 4)
+ goto skip;
+ if ((res = av_new_packet(pkt, len)) < 0)
return res;
avio_read(pb, pkt->data, 4);
if (AV_RB32(pkt->data) == 0xffd8ffd9 ||
@@ -214,6 +229,7 @@
return pkt->size;
}
skip:
+ len = FFMAX(0, len);
avio_skip(pb, len);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment