Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e786e96b
Commit
e786e96b
authored
Jul 09, 2015
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/rtpenc_jpeg: Error out for non-standard Huffman tables.
Related to ticket #3823.
parent
ad7c5cba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
rtpenc_jpeg.c
libavformat/rtpenc_jpeg.c
+20
-0
No files found.
libavformat/rtpenc_jpeg.c
View file @
e786e96b
...
...
@@ -21,6 +21,7 @@
#include "libavcodec/bytestream.h"
#include "libavcodec/mjpeg.h"
#include "libavcodec/jpegtables.h"
#include "libavutil/intreadwrite.h"
#include "rtpenc.h"
...
...
@@ -81,6 +82,25 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
"Only 1x1 chroma blocks are supported. Aborted!
\n
"
);
return
;
}
}
else
if
(
buf
[
i
+
1
]
==
DHT
)
{
if
(
AV_RB16
(
&
buf
[
i
+
2
])
<
418
||
i
+
420
>=
size
||
buf
[
i
+
4
]
!=
0x00
||
buf
[
i
+
33
]
!=
0x01
||
buf
[
i
+
62
]
!=
0x10
||
buf
[
i
+
241
]
!=
0x11
||
memcmp
(
buf
+
i
+
5
,
avpriv_mjpeg_bits_dc_luminance
+
1
,
16
)
||
memcmp
(
buf
+
i
+
21
,
avpriv_mjpeg_val_dc
,
12
)
||
memcmp
(
buf
+
i
+
34
,
avpriv_mjpeg_bits_dc_chrominance
+
1
,
16
)
||
memcmp
(
buf
+
i
+
50
,
avpriv_mjpeg_val_dc
,
12
)
||
memcmp
(
buf
+
i
+
63
,
avpriv_mjpeg_bits_ac_luminance
+
1
,
16
)
||
memcmp
(
buf
+
i
+
79
,
avpriv_mjpeg_val_ac_luminance
,
162
)
||
memcmp
(
buf
+
i
+
242
,
avpriv_mjpeg_bits_ac_chrominance
+
1
,
16
)
||
memcmp
(
buf
+
i
+
258
,
avpriv_mjpeg_val_ac_chrominance
,
162
))
{
av_log
(
s1
,
AV_LOG_ERROR
,
"RFC 2435 requires standard Huffman tables for jpeg
\n
"
);
return
;
}
}
else
if
(
buf
[
i
+
1
]
==
SOS
)
{
/* SOS is last marker in the header */
i
+=
AV_RB16
(
&
buf
[
i
+
2
])
+
2
;
...
...
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