<div dir="ltr">Hi, you can check if pixel format ever changes between frames. Once up a time I also had a crash problem, which I later found is caused by pixel format change.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/5/19 yy-zed <span dir="ltr"><<a href="mailto:samhalligan15@gmail.com" target="_blank">samhalligan15@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Guys,<br>
<br>
I'm trying to figure out to cause of constant crashes on sws_scale calls.<br>
I'm reading in a video frame, decoding it, then trying to scale, encode and<br>
write to video. Reading the frame and decoding it seem to be working fine,<br>
but sws_scale keeps crashing.<br>
<br>
Here's where I set the context:<br>
<br>
<br>
p_codec_ctx<br>
=p_in_video_ctx->p_fmt_ctx->streams[p_in_video_ctx->i_video_stream_idx]->codec;<br>
<br>
p_out_video_ctx->p_sws_ctx = sws_getContext(p_codec_ctx->width,<br>
                p_codec_ctx->height, p_codec_ctx->pix_fmt,<br>
                p_out_video_ctx->i_vwidth, p_out_video_ctx->i_vheight,<br>
                AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);<br>
<br>
and here's where I make the call to scale the frame:<br>
<br>
debugLogR->debug("here1");<br>
sws_scale(p_out_video_ctx->p_sws_ctx,<br>
                (uint8_t const * const *) p_in_video_ctx->p_video_frame->data,<br>
                p_in_video_ctx->p_video_frame->linesize, 0, p_codec_ctx->height,<br>
                p_out_video_ctx->p_video_frame->data,<br>
                p_out_video_ctx->p_video_frame->linesize);<br>
<br>
debugLogR->debug("here2");<br>
<br>
here1 is printed, but the program exits with error code "-1073741819" before<br>
printing here2. Google tells me thats a general access memory violation.<br>
<br>
Has anybody got any ideas where I'm going wrong?<br>
<br>
Thanks,<br>
Sam<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://libav-users.943685.n4.nabble.com/sws-scale-crash-tp4657631.html" target="_blank">http://libav-users.943685.n4.nabble.com/sws-scale-crash-tp4657631.html</a><br>
Sent from the libav-users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div>