summaryrefslogtreecommitdiff
path: root/vpxdec.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2010-11-04 14:54:51 -0400
committerJohn Koleszar <jkoleszar@google.com>2010-11-04 14:56:48 -0400
commitbd05d9e480623536e35b76cf3cfd6b8884d254ba (patch)
tree450d328aaf628dd0a38cb4dbbc3ba06964d0a62c /vpxdec.c
parenta5397dbaf13c87516bbf404dea35fe49bfe805e3 (diff)
downloadlibvpx-bd05d9e480623536e35b76cf3cfd6b8884d254ba.tar
libvpx-bd05d9e480623536e35b76cf3cfd6b8884d254ba.tar.gz
libvpx-bd05d9e480623536e35b76cf3cfd6b8884d254ba.tar.bz2
libvpx-bd05d9e480623536e35b76cf3cfd6b8884d254ba.zip
vpxdec: report parse errors from webm_guess_framerate()
If this function fails silently, the nestegg context is destroyed and future nestegg calls will segfault. Change-Id: Ie6a0ea284ab9ddfa97b1843ef8030a953937c8cd
Diffstat (limited to 'vpxdec.c')
-rw-r--r--vpxdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/vpxdec.c b/vpxdec.c
index 85ab20693..9b565b022 100644
--- a/vpxdec.c
+++ b/vpxdec.c
@@ -542,6 +542,7 @@ webm_guess_framerate(struct input_ctx *input,
*fps_den = tstamp / 1000;
return 0;
fail:
+ nestegg_destroy(input->nestegg_ctx);
input->nestegg_ctx = NULL;
rewind(input->infile);
return 1;
@@ -878,7 +879,13 @@ int main(int argc, const char **argv_)
}
if(input.kind == WEBM_FILE)
- webm_guess_framerate(&input, &fps_den, &fps_num);
+ if(webm_guess_framerate(&input, &fps_den, &fps_num))
+ {
+ fprintf(stderr, "Failed to guess framerate -- error parsing "
+ "webm file?\n");
+ return EXIT_FAILURE;
+ }
+
/*Note: We can't output an aspect ratio here because IVF doesn't
store one, and neither does VP8.