size = sizeof(len);
memcpy(tempbuf + size, &got_picture, sizeof(got_picture));
size += sizeof(got_picture);
- deserialize_video_data(avctx, &video);
- memcpy(tempbuf + size, &video, sizeof(struct video_data));
+ if (avctx) {
+ deserialize_video_data(avctx, &video);
+ memcpy(tempbuf + size, &video, sizeof(struct video_data));
+ }
}
maru_brill_codec_push_writequeue(s, tempbuf, tempbuf_size, ctx_id);
static bool codec_picture_copy (MaruBrillCodecState *s, int ctx_id, void *elem)
{
- AVCodecContext *avctx;
- AVPicture *src;
+ AVCodecContext *avctx = NULL;
+ AVPicture *src = NULL;
AVPicture dst;
uint8_t *out_buffer = NULL, *tempbuf = NULL;
int pict_size = 0;
} else {
memcpy(tempbuf, &len, sizeof(len));
size = sizeof(len);
- if (len) {
+ if (len && outbuf) {
memcpy(tempbuf + size, outbuf, len);
}
}
} else {
memcpy(tempbuf, &len, sizeof(len));
size = sizeof(len);
- if (len) {
+ if (len && outbuf) {
memcpy(tempbuf + size, outbuf, len);
}
}