Skip to content
Snippets Groups Projects
Commit 680d27e6 authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud
Browse files

media_stream: fix null pointer dereference

Change-Id: I42eeb5c88f6f042c8057780fde65cac40f59cb8e
parent 79330e5d
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#pragma once #pragma once
#include "libav_deps.h" #include "libav_deps.h"
#include "logger.h"
#include "rational.h" #include "rational.h"
#include "audio/audiobuffer.h" #include "audio/audiobuffer.h"
...@@ -90,6 +91,7 @@ struct MediaStream { ...@@ -90,6 +91,7 @@ struct MediaStream {
: name(streamName) : name(streamName)
, firstTimestamp(startTimestamp) , firstTimestamp(startTimestamp)
{ {
if (c) {
timeBase = c->time_base; timeBase = c->time_base;
switch (c->codec_type) { switch (c->codec_type) {
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:
...@@ -110,6 +112,9 @@ struct MediaStream { ...@@ -110,6 +112,9 @@ struct MediaStream {
default: default:
break; break;
} }
} else {
JAMI_WARN() << "Trying to get stream info from null codec context";
}
} }
MediaStream(const MediaStream& other) = default; MediaStream(const MediaStream& other) = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment