[Libav-user] sws_scale crash

yy-zed samhalligan15 at gmail.com
Sat May 18 17:08:51 CEST 2013


Hi Guys, 

I'm trying to figure out to cause of constant crashes on sws_scale calls.
I'm reading in a video frame, decoding it, then trying to scale, encode and
write to video. Reading the frame and decoding it seem to be working fine,
but sws_scale keeps crashing.

Here's where I set the context:


p_codec_ctx
=p_in_video_ctx->p_fmt_ctx->streams[p_in_video_ctx->i_video_stream_idx]->codec;

p_out_video_ctx->p_sws_ctx = sws_getContext(p_codec_ctx->width,
		p_codec_ctx->height, p_codec_ctx->pix_fmt,
		p_out_video_ctx->i_vwidth, p_out_video_ctx->i_vheight,
		AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);

and here's where I make the call to scale the frame:

debugLogR->debug("here1");
sws_scale(p_out_video_ctx->p_sws_ctx,
		(uint8_t const * const *) p_in_video_ctx->p_video_frame->data,
		p_in_video_ctx->p_video_frame->linesize, 0, p_codec_ctx->height,
		p_out_video_ctx->p_video_frame->data,
		p_out_video_ctx->p_video_frame->linesize);

debugLogR->debug("here2");

here1 is printed, but the program exits with error code "-1073741819" before
printing here2. Google tells me thats a general access memory violation. 

Has anybody got any ideas where I'm going wrong?

Thanks, 
Sam




--
View this message in context: http://libav-users.943685.n4.nabble.com/sws-scale-crash-tp4657631.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list