Commit 1743938d authored by Martin Storsjö's avatar Martin Storsjö

rtpdec_jpeg: Disallow using the reserved q values

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 1de9317b
...@@ -304,6 +304,10 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg, ...@@ -304,6 +304,10 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
qtable_len = jpeg->qtables_len[q - 128]; qtable_len = jpeg->qtables_len[q - 128];
} }
} else { /* q <= 127 */ } else { /* q <= 127 */
if (q == 0 || q > 99) {
av_log(ctx, AV_LOG_ERROR, "Reserved q value %d\n", q);
return AVERROR_INVALIDDATA;
}
create_default_qtables(new_qtables, q); create_default_qtables(new_qtables, q);
qtables = new_qtables; qtables = new_qtables;
qtable_len = sizeof(new_qtables); qtable_len = sizeof(new_qtables);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment