Skip to content
Snippets Groups Projects
Commit 138902df authored by Clément Bœsch's avatar Clément Bœsch
Browse files

avformat/assdec: make sure pos is initialized

Fixes use of uninitialized memory
Fixes: signal_sigsegv_504fb0_10_signal_sigsegv_504fb0_343_mewmew_ssa.avi

Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
parent dceebe1a
No related branches found
No related tags found
No related merge requests found
...@@ -57,14 +57,14 @@ static int ass_read_close(AVFormatContext *s) ...@@ -57,14 +57,14 @@ static int ass_read_close(AVFormatContext *s)
static int read_dialogue(ASSContext *ass, AVBPrint *dst, const uint8_t *p, static int read_dialogue(ASSContext *ass, AVBPrint *dst, const uint8_t *p,
int64_t *start, int *duration) int64_t *start, int *duration)
{ {
int pos; int pos = 0;
int64_t end; int64_t end;
int hh1, mm1, ss1, ms1; int hh1, mm1, ss1, ms1;
int hh2, mm2, ss2, ms2; int hh2, mm2, ss2, ms2;
if (sscanf(p, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n", if (sscanf(p, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n",
&hh1, &mm1, &ss1, &ms1, &hh1, &mm1, &ss1, &ms1,
&hh2, &mm2, &ss2, &ms2, &pos) >= 8) { &hh2, &mm2, &ss2, &ms2, &pos) >= 8 && pos > 0) {
/* This is not part of the sscanf itself in order to handle an actual /* This is not part of the sscanf itself in order to handle an actual
* number (which would be the Layer) or the form "Marked=N" (which is * number (which would be the Layer) or the form "Marked=N" (which is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment