summaryrefslogtreecommitdiffstats
path: root/third_party/aom/examples/lightfield_bitstream_parsing.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/examples/lightfield_bitstream_parsing.c')
-rw-r--r--third_party/aom/examples/lightfield_bitstream_parsing.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/third_party/aom/examples/lightfield_bitstream_parsing.c b/third_party/aom/examples/lightfield_bitstream_parsing.c
index 71d4dec77..159f1617a 100644
--- a/third_party/aom/examples/lightfield_bitstream_parsing.c
+++ b/third_party/aom/examples/lightfield_bitstream_parsing.c
@@ -104,6 +104,7 @@ static int get_image_bps(aom_img_fmt_t fmt) {
case AOM_IMG_FMT_I44416: return 48;
default: die("Invalid image format");
}
+ return 0;
}
int main(int argc, char **argv) {
@@ -212,6 +213,7 @@ int main(int argc, char **argv) {
if (!aom_video_writer_write_frame(writer, frame_hdr_buf, bytes_to_copy,
pts))
die_codec(&codec, "Failed to copy compressed camera frame header.");
+ free(frame_hdr_buf);
}
// Read out the image format.
@@ -219,6 +221,7 @@ int main(int argc, char **argv) {
if (aom_codec_control(&codec, AV1D_GET_IMG_FORMAT, &ref_fmt))
die_codec(&codec, "Failed to get the image format");
const int bps = get_image_bps(ref_fmt);
+ if (!bps) die_codec(&codec, "Invalid image format.");
// read out the tile size.
unsigned int tile_size = 0;
if (aom_codec_control(&codec, AV1D_GET_TILE_SIZE, &tile_size))